Ignore:
Timestamp:
2012-01-23 14:09:21 (2 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 4.0, experimental-ims
Children:
e5a0c6
Parents:
ac78724
git-author:
Poul-Henning Kamp <phk@…> (2012-01-23 14:09:21)
git-committer:
Poul-Henning Kamp <phk@…> (2012-01-23 14:09:21)
Message:

Move the accept sockets into the new pool-task API and GC all the
cruft now not needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishd/cache/cache_session.c

    rac78724 rb04b83b  
    128128} 
    129129 
    130  /*-------------------------------------------------------------------- 
    131  * The pool-task for a newly accepted session 
    132  */ 
    133  
    134 void 
    135 SES_pool_accept_task(struct worker *wrk, void *arg) 
    136 { 
    137         struct sesspool *pp; 
    138  
    139         CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); 
    140         CAST_OBJ_NOTNULL(pp, arg, SESSPOOL_MAGIC); 
    141  
    142         /* Turn accepted socket into a session */ 
    143         AZ(wrk->sp); 
    144         AN(wrk->ws->r); 
    145         wrk->sp = ses_new(pp); 
    146         if (wrk->sp == NULL) { 
    147                 VCA_FailSess(wrk); 
    148                 return; 
    149         } 
    150         VCA_SetupSess(wrk); 
    151         wrk->sp->step = STP_FIRST; 
    152         WS_Release(wrk->ws, 0); 
    153         SES_pool_task(wrk, wrk->sp); 
    154 } 
    155  
    156  
    157  
    158130/*-------------------------------------------------------------------- 
    159131 * The pool-task function for sessions 
    160132 */ 
    161133 
    162 void 
    163 SES_pool_task(struct worker *wrk, void *arg) 
     134static void 
     135ses_pool_task(struct worker *wrk, void *arg) 
    164136{ 
    165137        struct sess *sp; 
     
    193165 
    194166/*-------------------------------------------------------------------- 
     167 * The pool-task for a newly accepted session 
     168 */ 
     169 
     170void 
     171SES_pool_accept_task(struct worker *wrk, void *arg) 
     172{ 
     173        struct sesspool *pp; 
     174 
     175        CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); 
     176        CAST_OBJ_NOTNULL(pp, arg, SESSPOOL_MAGIC); 
     177 
     178        /* Turn accepted socket into a session */ 
     179        AZ(wrk->sp); 
     180        AN(wrk->ws->r); 
     181        wrk->sp = ses_new(pp); 
     182        if (wrk->sp == NULL) { 
     183                VCA_FailSess(wrk); 
     184                return; 
     185        } 
     186        VCA_SetupSess(wrk); 
     187        wrk->sp->step = STP_FIRST; 
     188        WS_Release(wrk->ws, 0); 
     189        ses_pool_task(wrk, wrk->sp); 
     190} 
     191 
     192/*-------------------------------------------------------------------- 
    195193 * Schedule a session back on a work-thread from its pool 
    196194 */ 
     
    208206 
    209207        AZ(sp->wrk); 
    210         sp->task.func = SES_pool_task; 
     208        sp->task.func = ses_pool_task; 
    211209        sp->task.priv = sp; 
    212210 
Note: See TracChangeset for help on using the changeset viewer.