do not try to cleanup ho in http_conn_established when called from
http2_conn_connect_stream_callback
Type: fix
Change-Id: I91422297b69cfef82b622113e194596205b44075
Signed-off-by: Matus Fabian <[email protected]>
req = http1_conn_alloc_req (hc);
http_req_state_change (req, HTTP_REQ_STATE_WAIT_APP_METHOD);
- return http_conn_established (hc, req, hc->hc_pa_app_api_ctx);
+ return http_conn_established (hc, req, hc->hc_pa_app_api_ctx, 0);
}
static void
&h2c->decoder_dynamic_table,
http2_default_conn_settings.header_table_size);
http_req_state_change (&req->base, HTTP_REQ_STATE_WAIT_APP_METHOD);
- if (http_conn_established (hc, &req->base, hc->hc_pa_app_api_ctx))
+ if (http_conn_established (hc, &req->base, hc->hc_pa_app_api_ctx, 0))
return HTTP2_ERROR_INTERNAL_ERROR;
}
hc->hc_pa_app_api_ctx);
req = http2_conn_alloc_req (hc, 0);
http_req_state_change (&req->base, HTTP_REQ_STATE_WAIT_APP_METHOD);
- return http_conn_established (hc, &req->base, parent_app_api_ctx);
+ return http_conn_established (hc, &req->base, parent_app_api_ctx, 1);
}
static void
always_inline int
http_conn_established (http_conn_t *hc, http_req_t *req,
- u32 parent_app_api_ctx)
+ u32 parent_app_api_ctx, u8 is_stream)
{
session_t *as;
app_worker_t *app_wrk;
http_conn_t *ho_hc;
int rv;
- ho_hc = http_ho_conn_get (hc->ho_index);
- /* in chain with TLS there is race on half-open cleanup */
- __atomic_fetch_or (&ho_hc->flags, HTTP_CONN_F_HO_DONE, __ATOMIC_RELEASE);
+ if (!is_stream)
+ {
+ ho_hc = http_ho_conn_get (hc->ho_index);
+ /* in chain with TLS there is race on half-open cleanup */
+ __atomic_fetch_or (&ho_hc->flags, HTTP_CONN_F_HO_DONE, __ATOMIC_RELEASE);
+ }
/* allocate app session and initialize */
as = session_alloc (hc->c_thread_index);