summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_aix_send_file.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-02-22 15:09:59 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-02-22 15:09:59 +0300
commit029942f4eb7196c2cff0d0e26bc6ff274138f7d8 (patch)
treef4686c4d7b9cd574fe94c6f4918479a580fecf75 /src/nxt_aix_send_file.c
parent059a8642898a6bd4b47d13a1c1d599cd44af7e1c (diff)
downloadunit-029942f4eb7196c2cff0d0e26bc6ff274138f7d8.tar.gz
unit-029942f4eb7196c2cff0d0e26bc6ff274138f7d8.tar.bz2
I/O operations refactoring.
Diffstat (limited to 'src/nxt_aix_send_file.c')
-rw-r--r--src/nxt_aix_send_file.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/nxt_aix_send_file.c b/src/nxt_aix_send_file.c
index b7cb3b28..6462efd5 100644
--- a/src/nxt_aix_send_file.c
+++ b/src/nxt_aix_send_file.c
@@ -32,7 +32,7 @@ nxt_aix_event_conn_io_send_file(nxt_event_conn_t *c, nxt_buf_t *b, size_t limit)
sb.size = 0;
sb.limit = limit;
- nhd = nxt_sendbuf_mem_coalesce(&sb);
+ nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb);
if (nhd == 0 && sb.sync) {
return 0;
@@ -53,7 +53,7 @@ nxt_aix_event_conn_io_send_file(nxt_event_conn_t *c, nxt_buf_t *b, size_t limit)
sb.iobuf = &tr;
sb.nmax = 1;
- ntr = nxt_sendbuf_mem_coalesce(&sb);
+ ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb);
nxt_memzero(&sfp, sizeof(struct sf_parms));
@@ -71,17 +71,16 @@ nxt_aix_event_conn_io_send_file(nxt_event_conn_t *c, nxt_buf_t *b, size_t limit)
sfp.trailer_length = tr.iov_len;
}
- nxt_log_debug(c->socket.log, "send_file(%d) fd:%FD @%O:%O hd:%ui tr:%ui",
- c->socket.fd, fb->file->fd, fb->file_pos, file_size,
- nhd, ntr);
+ nxt_debug(c->socket.task, "send_file(%d) fd:%FD @%O:%O hd:%ui tr:%ui",
+ c->socket.fd, fb->file->fd, fb->file_pos, file_size, nhd, ntr);
n = send_file(&c->socket.fd, &sfp, 0);
err = (n == -1) ? nxt_errno : 0;
sent = sfp.bytes_sent;
- nxt_log_debug(c->socket.log, "send_file(%d): %d sent:%O",
- c->socket.fd, n, sent);
+ nxt_debug(c->socket.task, "send_file(%d): %d sent:%O",
+ c->socket.fd, n, sent);
/*
* -1 an error has occurred, errno contains the error code;
@@ -102,16 +101,15 @@ nxt_aix_event_conn_io_send_file(nxt_event_conn_t *c, nxt_buf_t *b, size_t limit)
default:
c->socket.error = err;
- nxt_log_error(nxt_socket_error_level(err, c->socket.log_error),
- c->socket.log, "send_file(%d) failed %E \"%FN\" "
- "fd:%FD @%O:%O hd:%ui tr:%ui", c->socket.fd, err,
- fb->file->name, fb->file->fd, fb->file_pos,
- file_size, nhd, ntr);
+ nxt_log(c->socket.task, nxt_socket_error_level(err),
+ "send_file(%d) failed %E \"%FN\" fd:%FD @%O:%O hd:%ui tr:%ui",
+ c->socket.fd, err, fb->file->name, fb->file->fd, fb->file_pos,
+ file_size, nhd, ntr);
return NXT_ERROR;
}
- nxt_log_debug(c->socket.log, "sendfile() %E", err);
+ nxt_debug(c->socket.task, "sendfile() %E", err);
return sent;
}