Changeset 663301


Ignore:
Timestamp:
2012-02-19 11:21:44 (2 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 4.0
Children:
354438
Parents:
91d192c
git-author:
Poul-Henning Kamp <phk@…> (2012-02-19 11:21:44)
git-committer:
Poul-Henning Kamp <phk@…> (2012-02-19 11:21:44)
Message:

Make RFC2616_Ttl() take a busyobj

Location:
bin/varnishd/cache
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishd/cache/cache.h

    r91d192c r663301  
    998998 
    999999/* rfc2616.c */ 
    1000 void RFC2616_Ttl(const struct sess *sp); 
     1000void RFC2616_Ttl(struct busyobj *, unsigned xid); 
    10011001enum body_status RFC2616_Body(const struct sess *sp); 
    10021002unsigned RFC2616_Req_Gzip(const struct sess *sp); 
  • bin/varnishd/cache/cache_center.c

    r91d192c r663301  
    607607                EXP_Clr(&wrk->busyobj->exp); 
    608608                wrk->busyobj->exp.entered = W_TIM_real(wrk); 
    609                 RFC2616_Ttl(sp); 
     609                RFC2616_Ttl(wrk->busyobj, sp->req->xid); 
    610610 
    611611                /* pass from vclrecv{} has negative TTL */ 
  • bin/varnishd/cache/cache_rfc2616.c

    r9a6361 r663301  
    6464 
    6565void 
    66 RFC2616_Ttl(const struct sess *sp) 
     66RFC2616_Ttl(struct busyobj *bo, unsigned xid) 
    6767{ 
    6868        unsigned max_age, age; 
     
    7272        struct exp *expp; 
    7373 
    74         expp = &sp->wrk->busyobj->exp; 
    75  
    76         hp = sp->wrk->busyobj->beresp; 
     74        CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); 
     75        expp = &bo->exp; 
     76 
     77        hp = bo->beresp; 
    7778 
    7879        assert(expp->entered != 0.0 && !isnan(expp->entered)); 
     
    99100                h_date = VTIM_parse(p); 
    100101 
    101         switch (sp->req->err_code) { 
     102        switch (http_GetStatus(hp)) { 
    102103        default: 
    103104                expp->ttl = -1.; 
     
    168169 
    169170        /* calculated TTL, Our time, Date, Expires, max-age, age */ 
    170         VSLb(sp->req->vsl, SLT_TTL,     /* XXX Bo->vsl ? */ 
     171        VSLb(bo->vsl, SLT_TTL, 
    171172            "%u RFC %.0f %.0f %.0f %.0f %.0f %.0f %.0f %u", 
    172             sp->req->xid, expp->ttl, -1., -1., expp->entered, 
     173            xid, expp->ttl, -1., -1., expp->entered, 
    173174            expp->age, h_date, h_expires, max_age); 
    174175} 
Note: See TracChangeset for help on using the changeset viewer.