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

Move the HTC from sess to req, that's another 64 bytes.

parent 3abbb127
......@@ -615,6 +615,9 @@ struct req {
char *ws_req; /* WS above request data */
double t_resp;
struct http_conn htc[1];
};
/*--------------------------------------------------------------------*/
......@@ -670,10 +673,6 @@ struct sess {
/* Timestamps, all on TIM_real() timescale */
double t_req;
/* TBD fields ------------------------------------------------*/
struct http_conn htc[1];
};
/* Prototypes etc ----------------------------------------------------*/
......
......@@ -107,8 +107,12 @@ cnt_wait(struct sess *sp)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
wrk = sp->wrk;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
if (sp->req == NULL)
if (sp->req == NULL) {
SES_GetReq(sp);
HTC_Init(sp->req->htc, sp->ws, sp->fd, sp->vsl_id,
cache_param->http_req_size,
cache_param->http_req_hdr_len);
}
AZ(sp->req->vcl);
AZ(wrk->obj);
......@@ -126,9 +130,9 @@ cnt_wait(struct sess *sp)
assert(j >= 0);
now = VTIM_real();
if (j != 0)
i = HTC_Rx(sp->htc);
i = HTC_Rx(sp->req->htc);
else
i = HTC_Complete(sp->htc);
i = HTC_Complete(sp->req->htc);
if (i == 1) {
/* Got it, run with it */
sp->t_req = now;
......@@ -156,6 +160,8 @@ cnt_wait(struct sess *sp)
wrk->stats.sess_herd++;
SES_Charge(sp);
SES_ReleaseReq(sp);
WS_Release(sp->ws, 0);
WS_Reset(sp->ws, NULL);
WAIT_Enter(sp);
return (1);
}
......@@ -445,14 +451,14 @@ cnt_done(struct sess *sp)
WS_Reset(sp->ws, NULL);
WS_Reset(wrk->ws, NULL);
i = HTC_Reinit(sp->htc);
i = HTC_Reinit(sp->req->htc);
if (i == 1) {
wrk->stats.sess_pipeline++;
sp->t_req = sp->t_idle;
sp->step = STP_START;
return (0);
}
if (Tlen(sp->htc->rxbuf))
if (Tlen(sp->req->htc->rxbuf))
wrk->stats.sess_readahead++;
sp->step = STP_WAIT;
sp->t_req = sp->t_idle;
......@@ -1052,10 +1058,6 @@ cnt_first(struct sess *sp)
sp->addr, sp->port, sp->mylsock->name);
}
/* Receive a HTTP protocol request */
HTC_Init(sp->htc, sp->ws, sp->fd, sp->vsl_id,
cache_param->http_req_size,
cache_param->http_req_hdr_len);
wrk->acct_tmp.sess++;
sp->step = STP_WAIT;
......
......@@ -345,7 +345,7 @@ FetchReqBody(struct sess *sp)
rdcnt = sizeof buf;
else
rdcnt = content_length;
rdcnt = HTC_Read(sp->wrk, sp->htc, buf, rdcnt);
rdcnt = HTC_Read(sp->wrk, sp->req->htc, buf, rdcnt);
if (rdcnt <= 0)
return (1);
content_length -= rdcnt;
......
......@@ -658,7 +658,7 @@ http_DissectRequest(struct sess *sp)
uint16_t retval;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
htc = sp->htc;
htc = sp->req->htc;
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
hp = sp->http;
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
......
......@@ -82,9 +82,9 @@ PipeSession(struct sess *sp)
sp->wrk->acct_tmp.hdrbytes +=
http_Write(w, sp->vsl_id, sp->wrk->busyobj->bereq, 0);
if (sp->htc->pipeline.b != NULL)
if (sp->req->htc->pipeline.b != NULL)
sp->wrk->acct_tmp.bodybytes +=
WRW_Write(w, sp->htc->pipeline.b, Tlen(sp->htc->pipeline));
WRW_Write(w, sp->req->htc->pipeline.b, Tlen(sp->req->htc->pipeline));
i = WRW_FlushRelease(w);
......
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