diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-06-25 16:51:47 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-06-25 16:51:47 +0300 |
commit | 1a52d876f7e10d07f58deee6faeaf70a11a6110f (patch) | |
tree | f69ba903180b3deac3bba2ee7acda9d34f18d73c /src/nxt_http_error.c | |
parent | af31012815e20f0c92ed6ea803638a16ba47b0c2 (diff) | |
download | unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2 |
Introduced nxt_length() macro.
Diffstat (limited to 'src/nxt_http_error.c')
-rw-r--r-- | src/nxt_http_error.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_http_error.c b/src/nxt_http_error.c index 8b10f508..71f790e0 100644 --- a/src/nxt_http_error.c +++ b/src/nxt_http_error.c @@ -49,7 +49,7 @@ nxt_http_request_error(nxt_task_t *task, nxt_http_request_t *r, nxt_http_field_set(content_type, "Content-Type", "text/html"); r->resp.content_length = NULL; - r->resp.content_length_n = sizeof(error) - 1; + r->resp.content_length_n = nxt_length(error); r->state = &nxt_http_request_send_error_body_state; @@ -87,7 +87,7 @@ nxt_http_request_send_error_body(nxt_task_t *task, void *obj, void *data) out->mem.start = (u_char *) error; out->mem.pos = out->mem.start; - out->mem.free = out->mem.start + sizeof(error) - 1; + out->mem.free = out->mem.start + nxt_length(error); out->mem.end = out->mem.free; out->next = nxt_http_buf_last(r); |