mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
HTTP/2: fixed padding handling in HEADERS frame with CONTINUATION.
This commit is contained in:
parent
8050277acf
commit
cb173ff672
@ -1733,11 +1733,21 @@ ngx_http_v2_handle_continuation(ngx_http_v2_connection_t *h2c, u_char *pos,
|
|||||||
u_char *end, ngx_http_v2_handler_pt handler)
|
u_char *end, ngx_http_v2_handler_pt handler)
|
||||||
{
|
{
|
||||||
u_char *p;
|
u_char *p;
|
||||||
size_t len;
|
size_t len, skip;
|
||||||
uint32_t head;
|
uint32_t head;
|
||||||
|
|
||||||
len = h2c->state.length;
|
len = h2c->state.length;
|
||||||
|
|
||||||
|
if (h2c->state.padding && (size_t) (end - pos) > len) {
|
||||||
|
skip = ngx_min(h2c->state.padding, (end - pos) - len);
|
||||||
|
|
||||||
|
h2c->state.padding -= skip;
|
||||||
|
|
||||||
|
p = pos;
|
||||||
|
pos += skip;
|
||||||
|
ngx_memmove(pos, p, len);
|
||||||
|
}
|
||||||
|
|
||||||
if ((size_t) (end - pos) < len + NGX_HTTP_V2_FRAME_HEADER_SIZE) {
|
if ((size_t) (end - pos) < len + NGX_HTTP_V2_FRAME_HEADER_SIZE) {
|
||||||
return ngx_http_v2_state_save(h2c, pos, end, handler);
|
return ngx_http_v2_state_save(h2c, pos, end, handler);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user