~chtsanti/squid/icap-max-connections

« back to all changes in this revision

Viewing changes to src/htcp.cc

  • Committer: Christos Tsantilas
  • Date: 2009-04-11 09:00:59 UTC
  • mfrom: (9294.1.333 trunk)
  • Revision ID: chtsanti@users.sourceforge.net-20090411090059-8n47p1kyy1cqfqkn
MergeĀ FromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "squid.h"
37
37
#include "htcp.h"
38
 
#include "ACLChecklist.h"
39
 
#include "ACL.h"
 
38
#include "acl/FilledChecklist.h"
 
39
#include "acl/Acl.h"
40
40
#include "SquidTime.h"
41
41
#include "Store.h"
42
42
#include "StoreClient.h"
167
167
    htcpDataHeader *dhdr;
168
168
};
169
169
 
170
 
MEMPROXY_CLASS_INLINE(htcpSpecifier)            /**DOCS_NOSEMI*/
 
170
MEMPROXY_CLASS_INLINE(htcpSpecifier);
171
171
 
172
172
struct _htcpDetail {
173
173
    char *resp_hdrs;
850
850
    if (!acl)
851
851
        return 0;
852
852
 
853
 
    ACLChecklist checklist;
 
853
    ACLFilledChecklist checklist(acl, s->request, NULL);
854
854
    checklist.src_addr = from;
855
855
    checklist.my_addr.SetNoAddr();
856
 
    checklist.request = HTTPMSGLOCK(s->request);
857
 
    checklist.accessList = cbdataReference(acl);
858
 
    /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
859
856
    int result = checklist.fastCheck();
860
857
    return result;
861
858
}
884
881
        stuff.S.uri = spec->uri;
885
882
        stuff.S.version = spec->version;
886
883
        stuff.S.req_hdrs = spec->req_hdrs;
887
 
        hdr.putInt(HDR_AGE,
888
 
                   e->timestamp <= squid_curtime ?
889
 
                   squid_curtime - e->timestamp : 0);
 
884
        if (e)
 
885
            hdr.putInt(HDR_AGE, (e->timestamp <= squid_curtime ? (squid_curtime - e->timestamp) : 0) );
 
886
        else
 
887
            hdr.putInt(HDR_AGE, 0);
890
888
        hdr.packInto(&p);
891
889
        stuff.D.resp_hdrs = xstrdup(mb.buf);
892
890
        debugs(31, 3, "htcpTstReply: resp_hdrs = {" << stuff.D.resp_hdrs << "}");
893
891
        mb.reset();
894
892
        hdr.reset();
895
893
 
896
 
        if (e->expires > -1)
 
894
        if (e && e->expires > -1)
897
895
            hdr.putTime(HDR_EXPIRES, e->expires);
898
896
 
899
 
        if (e->lastmod > -1)
 
897
        if (e && e->lastmod > -1)
900
898
            hdr.putTime(HDR_LAST_MODIFIED, e->lastmod);
901
899
 
902
900
        hdr.packInto(&p);