Commit 5011af25 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add some asserts to narrow #1147 and #1148 down

parent 344a709c
...@@ -116,6 +116,7 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req) ...@@ -116,6 +116,7 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
SES_GetReq(sp); SES_GetReq(sp);
req = sp->req; 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, HTC_Init(req->htc, req->ws, sp->fd, sp->req->vsl,
cache_param->http_req_size, cache_param->http_req_size,
cache_param->http_req_hdr_len); cache_param->http_req_hdr_len);
...@@ -928,6 +929,7 @@ DOT first -> wait [style=bold,color=green] ...@@ -928,6 +929,7 @@ DOT first -> wait [style=bold,color=green]
static int static int
cnt_first(struct sess *sp, struct worker *wrk) cnt_first(struct sess *sp, struct worker *wrk)
{ {
struct req *req;
char laddr[ADDR_BUFSIZE]; char laddr[ADDR_BUFSIZE];
char lport[PORT_BUFSIZE]; char lport[PORT_BUFSIZE];
...@@ -936,8 +938,10 @@ cnt_first(struct sess *sp, struct worker *wrk) ...@@ -936,8 +938,10 @@ 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 */
SES_GetReq(sp); SES_GetReq(sp);
CHECK_OBJ_NOTNULL(sp->req, REQ_MAGIC); req = sp->req;
HTC_Init(sp->req->htc, sp->req->ws, sp->fd, sp->req->vsl, 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_size,
cache_param->http_req_hdr_len); cache_param->http_req_hdr_len);
...@@ -949,11 +953,11 @@ cnt_first(struct sess *sp, struct worker *wrk) ...@@ -949,11 +953,11 @@ cnt_first(struct sess *sp, struct worker *wrk)
VTCP_name(&sp->mysockaddr, sp->mysockaddrlen, VTCP_name(&sp->mysockaddr, sp->mysockaddrlen,
laddr, sizeof laddr, lport, sizeof lport); laddr, sizeof laddr, lport, sizeof lport);
/* XXX: have no req yet */ /* XXX: have no req yet */
VSLb(sp->req->vsl, SLT_SessionOpen, "%s %s %s %s", VSLb(req->vsl, SLT_SessionOpen, "%s %s %s %s",
sp->addr, sp->port, laddr, lport); sp->addr, sp->port, laddr, lport);
} else { } else {
/* XXX: have no req yet */ /* XXX: have no req yet */
VSLb(sp->req->vsl, SLT_SessionOpen, "%s %s %s", VSLb(req->vsl, SLT_SessionOpen, "%s %s %s",
sp->addr, sp->port, sp->mylsock->name); sp->addr, sp->port, sp->mylsock->name);
} }
......
...@@ -338,6 +338,8 @@ void \ ...@@ -338,6 +338,8 @@ void \
VCL_##func##_method(struct req *req) \ VCL_##func##_method(struct req *req) \
{ \ { \
\ \
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); \
CHECK_OBJ_NOTNULL(req->sp, SESS_MAGIC); \
req->handling = 0; \ req->handling = 0; \
req->cur_method = VCL_MET_ ## upper; \ req->cur_method = VCL_MET_ ## upper; \
VSLb(req->vsl, SLT_VCL_call, "%s", #func); \ VSLb(req->vsl, SLT_VCL_call, "%s", #func); \
......
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