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);
void SES_DeletePool(struct sesspool *sp);
int SES_Schedule(struct sess *sp);
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);
pool_func_t SES_pool_accept_task;
......
......@@ -110,16 +110,10 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
assert(!isnan(sp->t_rx));
if (req == NULL) {
SES_GetReq(sp);
req = sp->req;
req = SES_GetReq(sp);
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->obj);
......@@ -945,13 +939,9 @@ cnt_first(struct sess *sp, struct worker *wrk)
/* Allocate a request already now, so we can VSL to it */
AZ(sp->req);
SES_GetReq(sp);
req = sp->req;
req = SES_GetReq(sp);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
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,
sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
......
......@@ -287,7 +287,7 @@ SES_Delete(struct sess *sp, const char *reason, double now)
* Alloc/Free sp->req
*/
void
struct req *
SES_GetReq(struct sess *sp)
{
struct sesspool *pp;
......@@ -341,6 +341,12 @@ SES_GetReq(struct sess *sp)
assert(p < e);
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
......
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