Commit ba34fd3a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Put a protocol prefix on enum sess_step.

In the future we will need to tell what protocol controls a give
session, for instance when we come back from the waiter or waiting
list.   Rather than spend memory on a dedicated field for this,
protocols will share the enum sess_step, and ranges will be used
to dispatch to protocols.
parent fc8e57f6
...@@ -228,7 +228,7 @@ SES_sess_pool_task(struct worker *wrk, void *arg) ...@@ -228,7 +228,7 @@ SES_sess_pool_task(struct worker *wrk, void *arg)
req = SES_GetReq(wrk, sp); req = SES_GetReq(wrk, sp);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
sp->sess_step = S_STP_NEWREQ; sp->sess_step = S_STP_H1NEWREQ;
wrk->task.func = ses_req_pool_task; wrk->task.func = ses_req_pool_task;
wrk->task.priv = req; wrk->task.priv = req;
......
...@@ -347,7 +347,7 @@ HTTP1_Session(struct worker *wrk, struct req *req) ...@@ -347,7 +347,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
* or waiter, but we'd rather do the syscall in the worker thread. * or waiter, but we'd rather do the syscall in the worker thread.
* On systems which return errors for ioctl, we close early * On systems which return errors for ioctl, we close early
*/ */
if (sp->sess_step == S_STP_NEWREQ && VTCP_blocking(sp->fd)) { if (sp->sess_step == S_STP_H1NEWREQ && VTCP_blocking(sp->fd)) {
if (errno == ECONNRESET) if (errno == ECONNRESET)
SES_Close(sp, SC_REM_CLOSE); SES_Close(sp, SC_REM_CLOSE);
else else
...@@ -370,7 +370,7 @@ HTTP1_Session(struct worker *wrk, struct req *req) ...@@ -370,7 +370,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
return; return;
} }
if (sp->sess_step == S_STP_NEWREQ) { if (sp->sess_step == S_STP_H1NEWREQ) {
req->htc->fd = sp->fd; req->htc->fd = sp->fd;
HTTP1_RxInit(req->htc, req->ws, HTTP1_RxInit(req->htc, req->ws,
cache_param->http_req_size, cache_param->http_req_hdr_len); cache_param->http_req_size, cache_param->http_req_hdr_len);
...@@ -378,11 +378,11 @@ HTTP1_Session(struct worker *wrk, struct req *req) ...@@ -378,11 +378,11 @@ HTTP1_Session(struct worker *wrk, struct req *req)
while (1) { while (1) {
assert( assert(
sp->sess_step == S_STP_NEWREQ || sp->sess_step == S_STP_H1NEWREQ ||
req->req_step == R_STP_LOOKUP || req->req_step == R_STP_LOOKUP ||
req->req_step == R_STP_RECV); req->req_step == R_STP_RECV);
if (sp->sess_step == S_STP_WORKING) { if (sp->sess_step == S_STP_H1WORKING) {
if (req->req_step == R_STP_RECV) if (req->req_step == R_STP_RECV)
nxt = http1_dissect(wrk, req); nxt = http1_dissect(wrk, req);
if (nxt == REQ_FSM_MORE) if (nxt == REQ_FSM_MORE)
...@@ -395,10 +395,10 @@ HTTP1_Session(struct worker *wrk, struct req *req) ...@@ -395,10 +395,10 @@ HTTP1_Session(struct worker *wrk, struct req *req)
case SESS_DONE_RET_GONE: case SESS_DONE_RET_GONE:
return; return;
case SESS_DONE_RET_WAIT: case SESS_DONE_RET_WAIT:
sp->sess_step = S_STP_NEWREQ; sp->sess_step = S_STP_H1NEWREQ;
break; break;
case SESS_DONE_RET_START: case SESS_DONE_RET_START:
sp->sess_step = S_STP_WORKING; sp->sess_step = S_STP_H1WORKING;
req->req_step = R_STP_RECV; req->req_step = R_STP_RECV;
break; break;
default: default:
...@@ -406,11 +406,11 @@ HTTP1_Session(struct worker *wrk, struct req *req) ...@@ -406,11 +406,11 @@ HTTP1_Session(struct worker *wrk, struct req *req)
} }
} }
if (sp->sess_step == S_STP_NEWREQ) { if (sp->sess_step == S_STP_H1NEWREQ) {
nxt = http1_wait(sp, wrk, req); nxt = http1_wait(sp, wrk, req);
if (nxt != REQ_FSM_MORE) if (nxt != REQ_FSM_MORE)
return; return;
sp->sess_step = S_STP_WORKING; sp->sess_step = S_STP_H1WORKING;
req->req_step = R_STP_RECV; req->req_step = R_STP_RECV;
} }
} }
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
/*lint -save -e525 -e539 */ /*lint -save -e525 -e539 */
#ifdef SESS_STEP #ifdef SESS_STEP
SESS_STEP(newreq, NEWREQ) SESS_STEP(h1newreq, H1NEWREQ)
SESS_STEP(working, WORKING) SESS_STEP(h1working, H1WORKING)
#endif #endif
#ifdef REQ_STEP #ifdef REQ_STEP
......
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