Lines 275-281
static int on_begin_headers_cb(nghttp2_session *ngh2,
Link Here
|
275 |
const nghttp2_frame *frame, void *userp) |
275 |
const nghttp2_frame *frame, void *userp) |
276 |
{ |
276 |
{ |
277 |
h2_session *session = (h2_session *)userp; |
277 |
h2_session *session = (h2_session *)userp; |
278 |
h2_stream *s; |
278 |
h2_stream *s = NULL; |
279 |
|
279 |
|
280 |
/* We may see HEADERs at the start of a stream or after all DATA |
280 |
/* We may see HEADERs at the start of a stream or after all DATA |
281 |
* streams to carry trailers. */ |
281 |
* streams to carry trailers. */ |
Lines 284-290
static int on_begin_headers_cb(nghttp2_session *ngh2,
Link Here
|
284 |
if (s) { |
284 |
if (s) { |
285 |
/* nop */ |
285 |
/* nop */ |
286 |
} |
286 |
} |
287 |
else { |
287 |
else if (session->local.accepting) { |
288 |
s = h2_session_open_stream(userp, frame->hd.stream_id, 0); |
288 |
s = h2_session_open_stream(userp, frame->hd.stream_id, 0); |
289 |
} |
289 |
} |
290 |
return s? 0 : NGHTTP2_ERR_START_STREAM_NOT_ALLOWED; |
290 |
return s? 0 : NGHTTP2_ERR_START_STREAM_NOT_ALLOWED; |
Lines 2115-2121
apr_status_t h2_session_process(h2_session *session, int async)
Link Here
|
2115 |
now = apr_time_now(); |
2115 |
now = apr_time_now(); |
2116 |
session->have_read = session->have_written = 0; |
2116 |
session->have_read = session->have_written = 0; |
2117 |
|
2117 |
|
2118 |
if (session->local.accepting |
2118 |
/* PR65731: we may get a new connection to process while the |
|
|
2119 |
* MPM already is stopping. For example due to having reached |
2120 |
* MaxRequestsPerChild limit. |
2121 |
* Since this is supposed to handle things gracefully, we need to: |
2122 |
* a) fully initialize the session before GOAWAYing |
2123 |
* b) give the client the chance to submit at least one request |
2124 |
*/ |
2125 |
if (session->state != H2_SESSION_ST_INIT /* no longer intializing */ |
2126 |
&& session->local.accepted_max > 0 /* have gotten at least one stream */ |
2127 |
&& session->local.accepting /* have not already locally shut down */ |
2119 |
&& !ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state)) { |
2128 |
&& !ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state)) { |
2120 |
if (mpm_state == AP_MPMQ_STOPPING) { |
2129 |
if (mpm_state == AP_MPMQ_STOPPING) { |
2121 |
dispatch_event(session, H2_SESSION_EV_MPM_STOPPING, 0, NULL); |
2130 |
dispatch_event(session, H2_SESSION_EV_MPM_STOPPING, 0, NULL); |