summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_freebsd_sendfile.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_freebsd_sendfile.c
parent059a8642898a6bd4b47d13a1c1d599cd44af7e1c (diff)
downloadunit-029942f4eb7196c2cff0d0e26bc6ff274138f7d8.tar.gz
unit-029942f4eb7196c2cff0d0e26bc6ff274138f7d8.tar.bz2
I/O operations refactoring.
Diffstat (limited to '')
-rw-r--r--src/nxt_freebsd_sendfile.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/nxt_freebsd_sendfile.c b/src/nxt_freebsd_sendfile.c
index 4a61d60f..a9535c10 100644
--- a/src/nxt_freebsd_sendfile.c
+++ b/src/nxt_freebsd_sendfile.c
@@ -92,7 +92,7 @@ nxt_freebsd_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
hdtr.trl_cnt = ntr;
}
- nxt_log_debug(c->socket.log, "sendfile(%FD, %d, @%O, %uz) hd:%ui tr:%ui",
+ nxt_debug(c->socket.task, "sendfile(%FD, %d, @%O, %uz) hd:%ui tr:%ui",
fb->file->fd, c->socket.fd, fb->file_pos, file_size,
nhd, ntr);
@@ -102,7 +102,7 @@ nxt_freebsd_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
err = (n == -1) ? nxt_errno : 0;
- nxt_log_debug(c->socket.log, "sendfile(): %d sent:%O", n, sent);
+ nxt_debug(c->socket.task, "sendfile(): %d sent:%O", n, sent);
if (n == -1) {
switch (err) {
@@ -116,23 +116,21 @@ nxt_freebsd_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
default:
c->socket.error = err;
- nxt_log_error(nxt_socket_error_level(err, c->socket.log_error),
- c->socket.log, "sendfile(%FD, %d, %O, %uz) failed "
- "%E \"%FN\" hd:%ui tr:%ui", fb->file->fd,
- c->socket.fd, fb->file_pos, file_size,
- err, fb->file->name, nhd, ntr);
+ nxt_log(c->socket.task, nxt_socket_error_level(err),
+ "sendfile(%FD, %d, %O, %uz) failed %E \"%FN\" hd:%ui tr:%ui",
+ fb->file->fd, c->socket.fd, fb->file_pos, file_size, err,
+ fb->file->name, nhd, ntr);
return NXT_ERROR;
}
- nxt_log_debug(c->socket.log, "sendfile() %E", err);
+ nxt_debug(c->socket.task, "sendfile() %E", err);
return sent;
} else if (sent == 0) {
- nxt_log_error(NXT_LOG_ERR, c->socket.log,
- "file \"%FN\" was truncated while sendfile()",
- fb->file->name);
+ nxt_log(c->socket.task, NXT_LOG_ERR,
+ "file \"%FN\" was truncated while sendfile()", fb->file->name);
return NXT_ERROR;
}