]> git.kaiwu.me - nginx.git/commitdiff
Upstream: even better handling of invalid headers in cache files.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 9 Oct 2017 12:59:10 +0000 (15:59 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 9 Oct 2017 12:59:10 +0000 (15:59 +0300)
When parsing of headers in a cache file fails, already parsed headers
need to be cleared, and protocol state needs to be reinitialized.  To do
so, u->request_sent is now set to ensure ngx_http_upstream_reinit() will
be called.

This change complements improvements in 46ddff109e72.

src/http/ngx_http_upstream.c

index 985d633e0e5b8a97bd60be2e0c7430adb7e430b8..1f6a8fe0cbb4f65d6091d35799cbc7c37464a4b5 100644 (file)
@@ -584,6 +584,7 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
                 r->cached = 0;
                 u->buffer.start = NULL;
                 u->cache_status = NGX_HTTP_CACHE_MISS;
+                u->request_sent = 1;
             }
 
             if (ngx_http_upstream_cache_background_update(r, u) != NGX_OK) {