Commit 99d67512 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make HTC_Init() part of getting a request

parent 47c7bc11
...@@ -921,7 +921,7 @@ struct sesspool *SES_NewPool(struct pool *pp, unsigned pool_no); ...@@ -921,7 +921,7 @@ struct sesspool *SES_NewPool(struct pool *pp, unsigned pool_no);
void SES_DeletePool(struct sesspool *sp); void SES_DeletePool(struct sesspool *sp);
int SES_Schedule(struct sess *sp); int SES_Schedule(struct sess *sp);
void SES_Handle(struct sess *sp, double now); void SES_Handle(struct sess *sp, double now);
void SES_GetReq(struct sess *sp); struct req *SES_GetReq(struct sess *sp);
void SES_ReleaseReq(struct sess *sp); void SES_ReleaseReq(struct sess *sp);
pool_func_t SES_pool_accept_task; pool_func_t SES_pool_accept_task;
......
...@@ -110,16 +110,10 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req) ...@@ -110,16 +110,10 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
assert(!isnan(sp->t_rx)); assert(!isnan(sp->t_rx));
if (req == NULL) { if (req == NULL) {
SES_GetReq(sp); req = SES_GetReq(sp);
req = sp->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
assert(req->sp == sp);
HTC_Init(req->htc, req->ws, sp->fd, sp->req->vsl,
cache_param->http_req_size,
cache_param->http_req_hdr_len);
} else {
assert(req->sp == sp);
} }
assert(req->sp == sp);
AZ(req->vcl); AZ(req->vcl);
AZ(req->obj); AZ(req->obj);
...@@ -945,13 +939,9 @@ cnt_first(struct sess *sp, struct worker *wrk) ...@@ -945,13 +939,9 @@ cnt_first(struct sess *sp, struct worker *wrk)
/* Allocate a request already now, so we can VSL to it */ /* Allocate a request already now, so we can VSL to it */
AZ(sp->req); AZ(sp->req);
SES_GetReq(sp); req = SES_GetReq(sp);
req = sp->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
assert(req->sp == sp); assert(req->sp == sp);
HTC_Init(req->htc, req->ws, sp->fd, req->vsl,
cache_param->http_req_size,
cache_param->http_req_hdr_len);
VTCP_name(&sp->sockaddr, sp->sockaddrlen, VTCP_name(&sp->sockaddr, sp->sockaddrlen,
sp->addr, sizeof sp->addr, sp->port, sizeof sp->port); sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
......
...@@ -287,7 +287,7 @@ SES_Delete(struct sess *sp, const char *reason, double now) ...@@ -287,7 +287,7 @@ SES_Delete(struct sess *sp, const char *reason, double now)
* Alloc/Free sp->req * Alloc/Free sp->req
*/ */
void struct req *
SES_GetReq(struct sess *sp) SES_GetReq(struct sess *sp)
{ {
struct sesspool *pp; struct sesspool *pp;
...@@ -341,6 +341,12 @@ SES_GetReq(struct sess *sp) ...@@ -341,6 +341,12 @@ SES_GetReq(struct sess *sp)
assert(p < e); assert(p < e);
WS_Init(req->ws, "req", p, e - p); WS_Init(req->ws, "req", p, e - p);
HTC_Init(req->htc, req->ws, sp->fd, req->vsl,
cache_param->http_req_size,
cache_param->http_req_hdr_len);
return (req);
} }
void void
......
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