Commit 255b99a9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a new Req State to handle Expect & Connection, use it for H2.

parent 8f3ce041
......@@ -94,6 +94,17 @@ CNT_GotReq(struct worker *wrk, struct req *req)
return (0);
}
static enum req_fsm_nxt
cnt_transport(struct worker *wrk, struct req *req)
{
if (CNT_GotReq(wrk, req))
return (REQ_FSM_DONE);
req->req_step = R_STP_RECV;
return (REQ_FSM_MORE);
}
/*--------------------------------------------------------------------
* Deliver an object to client
*/
......@@ -961,6 +972,7 @@ CNT_Request(struct worker *wrk, struct req *req)
*/
assert(
req->req_step == R_STP_LOOKUP ||
req->req_step == R_STP_TRANSPORT ||
req->req_step == R_STP_RECV);
AN(req->vsl->wid & VSL_CLIENTMARKER);
......
......@@ -220,3 +220,4 @@ void h2_del_req(struct worker *, struct h2_req *);
int h2_rxframe(struct worker *, struct h2_sess *);
h2_error h2_set_setting(struct h2_sess *, const uint8_t *);
void h2_req_body(struct req*);
task_func_t h2_do_req;
......@@ -427,7 +427,7 @@ h2_rx_settings(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
* Incoming HEADERS, this is where the partys at...
*/
static void __match_proto__(task_func_t)
void __match_proto__(task_func_t)
h2_do_req(struct worker *wrk, void *priv)
{
struct req *req;
......@@ -436,8 +436,8 @@ h2_do_req(struct worker *wrk, void *priv)
CAST_OBJ_NOTNULL(req, priv, REQ_MAGIC);
CAST_OBJ_NOTNULL(r2, req->transport_priv, H2_REQ_MAGIC);
THR_SetRequest(req);
if (!CNT_GotReq(wrk, req))
assert(CNT_Request(wrk, req) != REQ_FSM_DISEMBARK);
req->req_step = R_STP_TRANSPORT;
assert(CNT_Request(wrk, req) != REQ_FSM_DISEMBARK);
THR_SetRequest(NULL);
VSL(SLT_Debug, 0, "H2REQ CNT done");
/* XXX clean up req */
......@@ -491,7 +491,6 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
h2->new_req = req;
req->sp = h2->sess;
req->req_step = R_STP_RECV;
req->transport = &H2_transport;
req->t_first = VTIM_real();
......
......@@ -115,28 +115,6 @@ h2_new_sess(const struct worker *wrk, struct sess *sp, struct req *srq)
return (h2);
}
/**********************************************************************
* Incoming HEADERS, this is where the partys at...
*/
static void __match_proto__(task_func_t)
h2_do_req(struct worker *wrk, void *priv)
{
struct req *req;
struct h2_req *r2;
CAST_OBJ_NOTNULL(req, priv, REQ_MAGIC);
CAST_OBJ_NOTNULL(r2, req->transport_priv, H2_REQ_MAGIC);
THR_SetRequest(req);
if (!CNT_GotReq(wrk, req))
assert(CNT_Request(wrk, req) != REQ_FSM_DISEMBARK);
THR_SetRequest(NULL);
VSL(SLT_Debug, 0, "H2REQ CNT done");
/* XXX clean up req */
r2->state = H2_S_CLOSED;
h2_del_req(wrk, r2);
}
/**********************************************************************/
enum htc_status_e __match_proto__(htc_complete_f)
......
......@@ -31,6 +31,7 @@
/*lint -save -e525 -e539 */
#ifdef REQ_STEP
REQ_STEP(transport, TRANSPORT, (wrk, req))
REQ_STEP(restart, RESTART, (wrk, req))
REQ_STEP(recv, RECV, (wrk, req))
REQ_STEP(pipe, PIPE, (wrk, req))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment