Changeset 7623:72b792bb3885 in nginx


Ignore:
Timestamp:
02/05/20 13:29:23 (13 days ago)
Author:
Sergey Kandaurov <pluknet@…>
Branch:
default
Phase:
public
Message:

HTTP/2: fixed socket leak with an incomplete HEADERS frame.

A connection could get stuck without timers if a client has partially sent
the HEADERS frame such that it was split on the individual header boundary.
In this case, it cannot be processed without the rest of the HEADERS frame.

The fix is to call ngx_http_v2_state_headers_save() in this case. Normally,
it would be called from the ngx_http_v2_state_header_block() handler on the
next iteration, when there is not enough data to continue processing. This
isn't the case if recv_buffer became empty and there's no more data to read.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/v2/ngx_http_v2.c

    r7618 r7623  
    17201720
    17211721    if (h2c->state.length) {
    1722         h2c->state.handler = ngx_http_v2_state_header_block;
    1723         return pos;
     1722        if (end - pos > 0) {
     1723            h2c->state.handler = ngx_http_v2_state_header_block;
     1724            return pos;
     1725        }
     1726
     1727        return ngx_http_v2_state_headers_save(h2c, pos, end,
     1728                                              ngx_http_v2_state_header_block);
    17241729    }
    17251730
Note: See TracChangeset for help on using the changeset viewer.