diff src/http/ngx_http_upstream.c @ 3439:3354dfba9da4 stable-0.7

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
author Igor Sysoev <igor@sysoev.ru>
date Mon, 01 Feb 2010 15:46:14 +0000
parents 0189a8f4c7c3
children d963fa32847e
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -712,6 +712,11 @@ ngx_http_upstream_cache_send(ngx_http_re
     r->cached = 1;
     c = r->cache;
 
+    if (c->header_start == c->body_start) {
+        r->http_version = NGX_HTTP_VERSION_9;
+        return ngx_http_cache_send(r);
+    }
+
     /* TODO: cache stack */
 
     u->buffer = *c->buf;
@@ -3017,7 +3022,7 @@ ngx_http_upstream_process_cache_control(
     n = 0;
 
     for (p += 8; p < last; p++) {
-        if (*p == ';' || *p == ' ') {
+        if (*p == ',' || *p == ';' || *p == ' ') {
             break;
         }