Commit 91d192cd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate wrk->sp

parent ce3ca928
......@@ -310,8 +310,6 @@ struct worker {
pthread_cond_t cond;
struct sess *sp;
struct VCL_conf *vcl;
struct vsl_log vsl[1];
......
......@@ -229,7 +229,6 @@ VCA_FailSess(struct worker *wrk)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CAST_OBJ_NOTNULL(wa, (void*)wrk->aws->f, WRK_ACCEPT_MAGIC);
AZ(wrk->sp);
AZ(close(wa->acceptsock));
wrk->stats.sess_drop++;
vca_pace_bad();
......
......@@ -1552,10 +1552,6 @@ CNT_Session(struct sess *sp)
struct worker *wrk;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
#if 0
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
MPL_AssertSane(req);
#endif
wrk = sp->wrk;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
......@@ -1590,10 +1586,6 @@ CNT_Session(struct sess *sp)
*/
for (done = 0; !done; ) {
assert(sp->wrk == wrk);
#if 0
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
MPL_AssertSane(req);
#endif
/*
* This is a good place to be paranoid about the various
* pointers still pointing to the things we expect.
......
......@@ -438,7 +438,6 @@ pool_herder(void *priv)
VSC_C_main->threads--;
VSC_C_main->threads_destroyed++;
Lck_Unlock(&pool_mtx);
AZ(wrk->sp);
wrk->task.func = NULL;
wrk->task.priv = NULL;
AZ(pthread_cond_signal(&wrk->cond));
......
......@@ -142,17 +142,11 @@ ses_pool_task(struct worker *wrk, void *arg)
AZ(wrk->aws->r);
wrk->lastused = NAN;
THR_SetSession(sp);
if (wrk->sp == NULL)
wrk->sp = sp;
else
assert(wrk->sp == sp);
AZ(sp->wrk);
sp->wrk = wrk;
CNT_Session(sp);
sp = NULL;
/* Cannot access sp now */
sp = NULL; /* Cannot access sp any longer */
THR_SetSession(NULL);
wrk->sp = NULL;
WS_Assert(wrk->aws);
AZ(wrk->busyobj);
AZ(wrk->wrw);
......@@ -171,20 +165,20 @@ void
SES_pool_accept_task(struct worker *wrk, void *arg)
{
struct sesspool *pp;
struct sess *sp;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CAST_OBJ_NOTNULL(pp, arg, SESSPOOL_MAGIC);
/* Turn accepted socket into a session */
AZ(wrk->sp);
AN(wrk->aws->r);
wrk->sp = ses_new(pp);
if (wrk->sp == NULL) {
sp = ses_new(pp);
if (sp == NULL) {
VCA_FailSess(wrk);
} else {
VCA_SetupSess(wrk, wrk->sp);
wrk->sp->step = STP_FIRST;
ses_pool_task(wrk, wrk->sp);
VCA_SetupSess(wrk, sp);
sp->step = STP_FIRST;
ses_pool_task(wrk, 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