nginx/src
Valentin Bartenev 0a5e969dd0 HTTP/2: fixed connection finalization.
All streams in connection must be finalized before the connection
itself can be finalized and all related memory is freed.  That's
not always possible on the current event loop iteration.

Thus when the last stream is finalized, it sets the special read
event handler ngx_http_v2_handle_connection_handler() and posts
the event.

Previously, this handler didn't check the connection state and
could call the regular event handler on a connection that was
already in finalization stage.  In the worst case that could
lead to a segmentation fault, since some data structures aren't
supposed to be used during connection finalization.  Particularly,
the waiting queue can contain already freed streams, so the
WINDOW_UPDATE frame received by that moment could trigger
accessing to these freed streams.

Now, the connection error flag is explicitly checked in
ngx_http_v2_handle_connection_handler().
2017-03-29 20:21:01 +03:00
..
core Use ngx_array_init() to initialize arrays. 2017-03-28 11:28:42 +03:00
event Core: set nginx_shared_zone name via ngx_str_set(). 2017-03-28 11:28:51 +03:00
http HTTP/2: fixed connection finalization. 2017-03-29 20:21:01 +03:00
mail Mail: don't emit separator in capability lists for APOP. 2017-03-06 17:56:23 +03:00
misc Style: fix typo. 2014-07-08 03:03:14 -07:00
os Simplified and improved sendfile() code on Linux. 2017-03-28 18:15:39 +03:00
stream Fixed ngx_open_cached_file() error handling. 2017-03-28 14:21:38 +03:00