app_worker_connect_notify (app_wrk, 0, SESSION_E_UNKNOWN,
hc->hc_pa_app_api_ctx);
}
- else
+ else if (!(hc->flags & HTTP_CONN_F_NO_APP_SESSION))
{
req = http2_req_get (h2c->parent_req_index, hc->c_thread_index);
session_transport_reset_notify (&req->base.connection);
}
+ else
+ {
+ http_disconnect_transport (hc);
+ return;
+ }
}
if (clib_llist_elt_is_linked (h2c, sched_list))
clib_llist_remove (wrk->conn_pool, sched_list, h2c);
/* in chain with TLS there is race on half-open cleanup */
__atomic_fetch_or (&ho_hc->flags, HTTP_CONN_F_HO_DONE, __ATOMIC_RELEASE);
+ app_wrk = app_worker_get_if_valid (hc->hc_pa_wrk_index);
+ if (!app_wrk)
+ {
+ HTTP_DBG (1, "no app worker");
+ req->c_s_index = SESSION_INVALID_INDEX;
+ return -1;
+ }
+
/* allocate app session and initialize */
as = session_alloc (hc->c_thread_index);
HTTP_DBG (1, "allocated session 0x%lx", session_handle (as));
TRANSPORT_PROTO_HTTP, session_type_is_ip4 (ts->session_type));
/* init session fifos and notify app */
- app_wrk = app_worker_get_if_valid (hc->hc_pa_wrk_index);
- if (!app_wrk)
- {
- HTTP_DBG (1, "no app worker");
- hc->flags |= HTTP_CONN_F_NO_APP_SESSION;
- return -1;
- }
-
if ((rv = app_worker_init_connected (app_wrk, as)))
{
HTTP_DBG (1, "failed to allocate fifos");
session_free (as);
- hc->flags |= HTTP_CONN_F_NO_APP_SESSION;
+ req->c_s_index = SESSION_INVALID_INDEX;
app_worker_connect_notify (app_wrk, 0, rv, parent_app_api_ctx);
return rv;
}
app_worker_connect_notify (app_wrk, as, 0, parent_app_api_ctx);
req->hr_pa_wrk_index = as->app_wrk_index;
+ hc->flags &= ~HTTP_CONN_F_NO_APP_SESSION;
return 0;
}