]> 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 53a9c26e9f2aabb3b003ab97ba78a93be3085166..421ec6e9491dab9d1c2e8ae4e8af03a57d172c55 100644 (file)
@@ -3537,8 +3537,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);