diff src/http/ngx_http_upstream.c @ 5959:f7584d7c0ccb

Cache: update variant while setting header. Some parts of code related to handling variants of a resource moved into a separate function that is called earlier. This allows to use cache file name as a prefix for temporary file in the following patch.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 26 Dec 2014 16:22:56 +0300
parents 610832763648
children e9effef98874
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2628,7 +2628,10 @@ ngx_http_upstream_send_response(ngx_http
                 }
             }
 
-            ngx_http_file_cache_set_header(r, u->buffer.start);
+            if (ngx_http_file_cache_set_header(r, u->buffer.start) != NGX_OK) {
+                ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
+                return;
+            }
 
         } else {
             u->cacheable = 0;