]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: prevented creating temp files for requests without body.
authorValentin Bartenev <vbart@nginx.com>
Sat, 10 Dec 2016 10:23:38 +0000 (13:23 +0300)
committerValentin Bartenev <vbart@nginx.com>
Sat, 10 Dec 2016 10:23:38 +0000 (13:23 +0300)
The problem was introduced by 52bd8cc17f34.

src/http/v2/ngx_http_v2.c

index b9ebcd8ce57daaaa78a1d16061b5f0460feed79a..f3050f1db2821b07ab7f3c15ac581f76043f5cd9 100644 (file)
@@ -3552,8 +3552,10 @@ ngx_http_v2_read_request_body(ngx_http_request_t *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);