summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_log_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-02-01 15:46:14 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-02-01 15:46:14 +0000
commit95a5ecb1ac78b14b759ada666b2114783fc1c2d2 (patch)
tree69fc825a431c976c901abe733501a8662e048845 /src/http/modules/ngx_http_log_module.c
parent848cc35a653e893add69b580c864d0cd8b419860 (diff)
downloadnginx-95a5ecb1ac78b14b759ada666b2114783fc1c2d2.tar.gz
nginx-95a5ecb1ac78b14b759ada666b2114783fc1c2d2.tar.bz2
merge r3137, r3198, r3199, r3353, r3370, r3371, r3398, r3399:
cache related fixes: *) do not pass buf with empty cached response, this fixes "zero size buf in output" alert *) hide cacheable Set-Cookie and P3P FastCGI response headers *) test comma separator in "Cache-Control" *) a cache manager thread handle was overwritten by a cache loader thread handle, this caused an exit delay, the bug had been introduced in r3248 *) fix handling cached HTTP/0.9 response *) log proxied HTTP/0.9 responses status as "009" *) fix the "If-None-Match" header name *) fix a cached zero-length body case
Diffstat (limited to 'src/http/modules/ngx_http_log_module.c')
-rw-r--r--src/http/modules/ngx_http_log_module.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
index e1d99c05a..515203889 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -542,8 +542,25 @@ ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
static u_char *
ngx_http_log_status(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
{
- return ngx_sprintf(buf, "%ui",
- r->err_status ? r->err_status : r->headers_out.status);
+ ngx_uint_t status;
+
+ if (r->err_status) {
+ status = r->err_status;
+
+ } else if (r->headers_out.status) {
+ status = r->headers_out.status;
+
+ } else if (r->http_version == NGX_HTTP_VERSION_9) {
+ *buf++ = '0';
+ *buf++ = '0';
+ *buf++ = '9';
+ return buf;
+
+ } else {
+ status = 0;
+ }
+
+ return ngx_sprintf(buf, "%ui", status);
}