summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
committerValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
commit1a52d876f7e10d07f58deee6faeaf70a11a6110f (patch)
treef69ba903180b3deac3bba2ee7acda9d34f18d73c /src/nxt_router.c
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index fa9dd17f..162e7073 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1880,8 +1880,8 @@ nxt_router_listen_socket_error(nxt_task_t *task, nxt_port_recv_msg_t *msg,
error = *p++;
- size = sizeof("listen socket error: ") - 1
- + sizeof("{listener: \"\", code:\"\", message: \"\"}") - 1
+ size = nxt_length("listen socket error: ")
+ + nxt_length("{listener: \"\", code:\"\", message: \"\"}")
+ sa->length + socket_errors[error].length + (in->mem.free - p);
out = nxt_buf_mem_alloc(tmcf->mem_pool, size, 0);
@@ -2753,7 +2753,7 @@ nxt_router_access_log_writer(nxt_task_t *task, nxt_http_request_t *r,
(nxt_atomic_uint_t) -1,
nxt_router_access_log_date,
"%02d/%s/%4d:%02d:%02d:%02d %c%02d%02d",
- sizeof("31/Dec/1986:19:40:00 +0300") - 1,
+ nxt_length("31/Dec/1986:19:40:00 +0300"),
NXT_THREAD_TIME_LOCAL,
NXT_THREAD_TIME_SEC,
};