changeset 6892:169fef913184 stable-1.10

HTTP/2: prevented creating temp files for requests without body. The problem was introduced by 52bd8cc17f34.
author Valentin Bartenev <vbart@nginx.com>
date Sat, 10 Dec 2016 13:23:38 +0300
parents 749bcfdf097a
children a3e6d660b179
files src/http/v2/ngx_http_v2.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -3537,8 +3537,10 @@ ngx_http_v2_read_request_body(ngx_http_r
         rb->buf = ngx_create_temp_buf(r->pool, (size_t) len);
 
     } else {
-        /* enforce writing body to file */
-        r->request_body_in_file_only = 1;
+        if (stream->preread) {
+            /* enforce writing preread buffer to file */
+            r->request_body_in_file_only = 1;
+        }
 
         rb->buf = ngx_calloc_buf(r->pool);