nginx h2 patch for 1.14.0 and fix spdy post bug #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Nginx SPDY POST request will cause nginx segment fault in 1.14.0 and nginx-1.13.12
src/http/ngx_http_spdy.c:ngx_http_spdy_state_read_data
buf->last = ngx_cpymem(buf->last, pos, size);
src/http/ngx_http_spdy.c:ngx_http_spdy_read_request_body
Cause problem in nginx-1.13.12 and 1.14.0, r->request_body has been inited BEFORE calling ngx_http_spdy_read_request_body in src/http/ngx_http_request_body.c.
So ngx_http_spdy_init_request_body will not run, and r->request_body->buf will be 0
If the patch for src/http/ngx_http_request_body.c still AFTER these codes:
The r->request_body has been inited beforce ngx_http_spdy_read_request_body called,
ngx_http_spdy_init_request_body will not run, and r->request_body->buf will be 0
https://github.com/cloudflare/sslconfig/blob/master/patches/nginx__1.13.0_http2_spdy.patch
http://lxr.nginx.org/source/src/http/ngx_http_request_body.c
0070-0073Which is different with nginx 1.12.2
http://lxr.nginx.org/source/src/http/ngx_http_request_body.c?v=nginx-1.12.2
So, I use "r->request_body->buf" replace "r->request_body"
Or you can move the following code BEFORE r->request_body has been inited