Commit 1172fc93 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Various minor cleanups for code clarity.

parent c34f10e1
......@@ -175,8 +175,8 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
}
}
}
AZ(req->vcl);
SES_ReleaseReq(req);
assert(why != SC_NULL);
SES_Delete(sp, why, now);
return (1);
}
......@@ -254,14 +254,8 @@ cnt_sess_done(struct sess *sp, struct worker *wrk, struct req *req)
req->hash_always_miss = 0;
req->hash_ignore_busy = 0;
if (sp->fd >= 0 && req->doclose != SC_NULL) {
/*
* This is an orderly close of the connection; ditch nolinger
* before we close, to get queued data transmitted.
*/
// XXX: not yet (void)VTCP_linger(sp->fd, 0);
if (sp->fd >= 0 && req->doclose != SC_NULL)
SES_Close(sp, req->doclose);
}
if (sp->fd < 0) {
wrk->stats.sess_closed++;
......
......@@ -133,12 +133,9 @@ static void
ses_req_pool_task(struct worker *wrk, void *arg)
{
struct req *req;
struct sess *sp;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CAST_OBJ_NOTNULL(req, arg, REQ_MAGIC);
sp = req->sp;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
THR_SetRequest(req);
AZ(wrk->aws->r);
......@@ -180,6 +177,9 @@ ses_sess_pool_task(struct worker *wrk, void *arg)
*
* We use VSL() to get the sessions vxid and to make sure tha this
* VSL comes before anything else for this session.
*
* This is a separate procedure only to isolate the two stack buffers.
*
*/
static void
......@@ -317,12 +317,7 @@ SES_Close(struct sess *sp, enum sess_close reason)
}
/*--------------------------------------------------------------------
* (Close &) Free or Recycle a session.
*
* If the workspace has changed, deleted it, otherwise wash it, and put
* it up for adoption.
*
* XXX: We should also check nhttp
* Report and dismantle a session.
*/
void
......@@ -338,27 +333,18 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
if (reason != SC_NULL)
SES_Close(sp, reason);
assert(sp->fd < 0);
if (isnan(now))
now = VTIM_real();
assert(!isnan(sp->t_open));
assert(sp->fd < 0);
if (*sp->addr == '\0')
strcpy(sp->addr, "-");
if (*sp->port == '\0')
strcpy(sp->addr, "-");
b = &sp->acct_ses;
VSL(SLT_SessClose, sp->vxid,
"%s %.3f %ju %ju %ju %ju %ju %ju",
sess_close_str(sp->reason, 0),
now - sp->t_open,
b->req, b->pipe, b->pass,
b->fetch, b->hdrbytes, b->bodybytes);
VSL(SLT_SessClose, sp->vxid, "%s %.3f %ju %ju %ju %ju %ju %ju",
sess_close_str(sp->reason, 0), now - sp->t_open, b->req,
b->pipe, b->pass, b->fetch, b->hdrbytes, b->bodybytes);
MPL_Free(pp->mpl_sess, sp);
}
/*--------------------------------------------------------------------
......
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