comparison src/http/ngx_http_upstream.c @ 7125:b8fc701daf8e

Upstream: even better handling of invalid headers in cache files. 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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 09 Oct 2017 15:59:10 +0300
parents dbd77a638eb7
children 77fe752b4586
comparison
equal deleted inserted replaced
7124:3b4fa572d56d 7125:b8fc701daf8e
582 if (rc == NGX_HTTP_UPSTREAM_INVALID_HEADER) { 582 if (rc == NGX_HTTP_UPSTREAM_INVALID_HEADER) {
583 rc = NGX_DECLINED; 583 rc = NGX_DECLINED;
584 r->cached = 0; 584 r->cached = 0;
585 u->buffer.start = NULL; 585 u->buffer.start = NULL;
586 u->cache_status = NGX_HTTP_CACHE_MISS; 586 u->cache_status = NGX_HTTP_CACHE_MISS;
587 u->request_sent = 1;
587 } 588 }
588 589
589 if (ngx_http_upstream_cache_background_update(r, u) != NGX_OK) { 590 if (ngx_http_upstream_cache_background_update(r, u) != NGX_OK) {
590 rc = NGX_ERROR; 591 rc = NGX_ERROR;
591 } 592 }