From: robertc <> Date: Tue, 15 Jul 2003 12:50:38 +0000 (+0000) Subject: Summary: Make all Arrays typesafe. X-Git-Tag: SQUID_3_0_PRE1~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75faaa7a998ef4029150e5e3563eefa21b2525c9;p=thirdparty%2Fsquid.git Summary: Make all Arrays typesafe. Keywords: Make all arrays typesafe. Remove C bindinds to Array logic (we can instate new ones easily if desired later on). Make all users of HttpHeader classes: htcpReplyData. Ensure all class contianing HttpHeader are constructed and destructed: htcpReplyData, request_t, HttpReply. rename request_t to HttpRequest. Move htcp prototypes to htcp.h. --- diff --git a/include/Array.h b/include/Array.h index 32dbd6e82c..a07cb34889 100644 --- a/include/Array.h +++ b/include/Array.h @@ -1,5 +1,5 @@ /* - * $Id: Array.h,v 1.14 2003/07/12 12:42:19 robertc Exp $ + * $Id: Array.h,v 1.15 2003/07/15 06:50:38 robertc Exp $ * * AUTHOR: Alex Rousskov * @@ -34,20 +34,14 @@ #ifndef SQUID_ARRAY_H #define SQUID_ARRAY_H -/* see Array.c for more documentation */ -#ifndef __cplusplus -typedef struct { - int capacity; - int count; - void **items; -} Array; -#endif +/* iterator support */ -#ifdef __cplusplus +template -/* iterator support */ -template class VectorIteratorBase { - public: +class VectorIteratorBase +{ + +public: VectorIteratorBase(); VectorIteratorBase(C &); VectorIteratorBase(size_t, C &); @@ -57,31 +51,37 @@ template class VectorIteratorBase { VectorIteratorBase & operator ++(); VectorIteratorBase operator ++(int); typename C::value_type & operator *() const - { - return theVector->items[pos]; - } - typename C::value_type * operator -> () const - { - return &theVector->items[pos]; - } + { + return theVector->items[pos]; + } + + typename C::value_type * operator -> () const + { + return &theVector->items[pos]; + } + ssize_t operator - (VectorIteratorBase const &rhs) const; bool incrementable() const; - private: + +private: size_t pos; C * theVector; }; - + template -class Vector { + +class Vector +{ + public: typedef E value_type; typedef E* pointer; typedef VectorIteratorBase > iterator; typedef VectorIteratorBase const> const_iterator; - + void *operator new (size_t); void operator delete (void *); - + Vector(); ~Vector(); Vector(Vector const &); @@ -98,26 +98,13 @@ public: const_iterator begin () const; iterator end(); const_iterator end () const; - + /* Do not change these, until the entry C struct is removed */ size_t capacity; size_t count; E *items; }; -typedef Vector Array; - -#endif - -SQUIDCEXTERN Array *arrayCreate(void); -SQUIDCEXTERN void arrayInit(Array * s); -SQUIDCEXTERN void arrayClean(Array * s); -SQUIDCEXTERN void arrayDestroy(Array * s); -SQUIDCEXTERN void arrayAppend(Array * s, void *obj); -SQUIDCEXTERN void arrayPreAppend(Array * s, int app_count); - -#ifdef __cplusplus - template void * Vector::operator new(size_t size) @@ -134,11 +121,10 @@ Vector::operator delete (void *address) template Vector::Vector() : capacity (0), count(0), items (NULL) -{ -} +{} template -Vector::~Vector() +Vector::~Vector() { clean(); } @@ -161,20 +147,29 @@ Vector::reserve(size_t min_capacity) { const int min_delta = 16; int delta; + if (capacity >= min_capacity) - return; + return; + delta = min_capacity; + /* make delta a multiple of min_delta */ delta += min_delta - 1; + delta /= min_delta; + delta *= min_delta; + /* actual grow */ if (delta < 0) - delta = min_capacity - capacity; + delta = min_capacity - capacity; + E*newitems = new E[capacity + delta]; + for (size_t counter = 0; counter < size(); ++counter) { - newitems[counter] = items[counter]; + newitems[counter] = items[counter]; } + capacity += delta; delete[]items; items = newitems; @@ -185,7 +180,8 @@ void Vector::push_back(E obj) { if (size() >= capacity) - reserve (size() + 1); + reserve (size() + 1); + items[count++] = obj; } @@ -213,7 +209,7 @@ void Vector::preAppend(int app_count) { if (size() + app_count > capacity) - reserve(size() + app_count); + reserve(size() + app_count); } template @@ -222,8 +218,10 @@ Vector::operator = (Vector const &old) { clean(); reserve (old.size()); + for (size_t counter = 0; counter < old.size(); ++counter) - push_back (old.items[counter]); + push_back (old.items[counter]); + return *this; } @@ -272,13 +270,11 @@ Vector::end() const template VectorIteratorBase::VectorIteratorBase() : pos(0), theVector(NULL) -{ -} +{} template VectorIteratorBase::VectorIteratorBase(C &container) : pos(container.begin()), theVector(&container) -{ -} +{} template VectorIteratorBase::VectorIteratorBase(size_t aPos, C &container) : pos(aPos), theVector(&container) {} @@ -298,7 +294,7 @@ bool VectorIteratorBase:: operator == (VectorIteratorBase const &rhs) } template -bool +bool VectorIteratorBase::incrementable() const { assert (theVector); @@ -309,9 +305,12 @@ template VectorIteratorBase & VectorIteratorBase:: operator ++() { assert (theVector); + if (!incrementable()) - fatal ("domain error"); + fatal ("domain error"); + ++pos; + return *this; } @@ -325,7 +324,8 @@ VectorIteratorBase VectorIteratorBase:: operator ++(int) template VectorIteratorBase& -VectorIteratorBase::operator =(VectorIteratorBase const &old) { +VectorIteratorBase::operator =(VectorIteratorBase const &old) +{ pos = old.pos; theVector = old.theVector; return *this; @@ -338,6 +338,5 @@ VectorIteratorBase::operator - (VectorIteratorBase const &rhs) const assert(theVector == rhs.theVector); return pos - rhs.pos; } -#endif #endif /* SQUID_ARRAY_H */ diff --git a/lib/Makefile.am b/lib/Makefile.am index 47288effda..ba8fb434fc 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am,v 1.11 2003/06/19 13:12:00 robertc Exp $ +# $Id: Makefile.am,v 1.12 2003/07/15 06:50:38 robertc Exp $ # SUBDIRS = libTrie @@ -39,7 +39,6 @@ EXTRA_libmiscutil_a_SOURCES = \ snprintf.c libmiscutil_a_SOURCES = \ MemPool.c \ - Array.cc \ base64.c \ getfullhostname.c \ hash.c \ diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 75aa3a465b..796c3c6dba 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.92 2003/07/14 14:15:56 robertc Exp $ + * $Id: HttpHeader.cc,v 1.93 2003/07/15 06:50:39 robertc Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -346,15 +346,22 @@ httpHeaderStatInit(HttpHeaderStat * hs, const char *label) * HttpHeader Implementation */ -void -httpHeaderInit(HttpHeader * hdr, http_hdr_owner_type owner) +HttpHeader::HttpHeader() : owner (hoNone), len (0) { - assert(hdr); - assert(owner > hoNone && owner <= hoReply); - debug(55, 7) ("init-ing hdr: %p owner: %d\n", hdr, owner); - memset(hdr, 0, sizeof(*hdr)); - hdr->owner = owner; - arrayInit(&hdr->entries); + httpHeaderMaskInit(&mask, 0); +} + +HttpHeader::HttpHeader(http_hdr_owner_type const &anOwner) : owner (anOwner), len (0) +{ + assert(this); + assert(anOwner > hoNone && anOwner <= hoReply); + debug(55, 7) ("init-ing hdr: %p owner: %d\n", this, owner); + httpHeaderMaskInit(&mask, 0); +} + +HttpHeader::~HttpHeader() +{ + httpHeaderClean (this); } void @@ -384,7 +391,7 @@ httpHeaderClean(HttpHeader * hdr) } } - arrayClean(&hdr->entries); + hdr->entries.clean(); } /* append entries (also see httpHeaderUpdate) */ @@ -439,7 +446,7 @@ httpHeaderReset(HttpHeader * hdr) assert(hdr); ho = hdr->owner; httpHeaderClean(hdr); - httpHeaderInit(hdr, ho); + *hdr = HttpHeader(ho); return 0; } @@ -667,7 +674,7 @@ httpHeaderAddEntry(HttpHeader * hdr, HttpHeaderEntry * e) else CBIT_SET(hdr->mask, e->id); - arrayAppend(&hdr->entries, e); + hdr->entries.push_back(e); /* increment header length, allow for ": " and crlf */ hdr->len += e->name.size() + 2 + e->value.size() + 2; diff --git a/src/HttpHeader.h b/src/HttpHeader.h index 95d9d81f18..0cc50961ba 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.h,v 1.5 2003/07/14 14:15:56 robertc Exp $ + * $Id: HttpHeader.h,v 1.6 2003/07/15 06:50:39 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -57,11 +57,14 @@ class HttpHeader { public: + HttpHeader(); + HttpHeader(http_hdr_owner_type const &owner); + ~HttpHeader(); /* Interface functions */ void update (HttpHeader const *fresh, HttpHeaderMask const *denied_mask); void removeConnectionHeaderEntries(); /* protected, do not use these, use interface functions instead */ - Array entries; /* parsed fields in raw format */ + Vector entries; /* parsed fields in raw format */ HttpHeaderMask mask; /* bit set <=> entry present */ http_hdr_owner_type owner; /* request or reply */ int len; /* length when packed, not counting terminating '\0' */ diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 3ae0b07383..679bf9b59b 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.61 2003/07/14 08:21:56 robertc Exp $ + * $Id: HttpReply.cc,v 1.62 2003/07/15 06:50:39 robertc Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -60,7 +60,6 @@ HttpMsgParseState &operator++ (HttpMsgParseState &aState) /* local routines */ -static void httpReplyInit(HttpReply * rep); static void httpReplyClean(HttpReply * rep); static void httpReplyDoDestroy(HttpReply * rep); static void httpReplyHdrCacheInit(HttpReply * rep); @@ -85,20 +84,16 @@ httpReplyCreate(void) { HttpReply *rep = new HttpReply; debug(58, 7) ("creating rep: %p\n", rep); - httpReplyInit(rep); return rep; } -static void -httpReplyInit(HttpReply * rep) +HttpReply::HttpReply() : hdr_sz (0), content_length (0), date (0), last_modified (0), expires (0), cache_control (NULL), surrogate_control (NULL), content_range (NULL), keep_alive (0), pstate(psReadyToParseStartLine), header (hoReply) { - assert(rep); - rep->hdr_sz = 0; - rep->pstate = psReadyToParseStartLine; - httpBodyInit(&rep->body); - httpHeaderInit(&rep->header, hoReply); - httpReplyHdrCacheInit(rep); - httpStatusLineInit(&rep->sline); + assert(this); + httpBodyInit(&body); + httpReplyHdrCacheInit(this); + httpStatusLineInit(&sline); + } static void @@ -124,7 +119,7 @@ void httpReplyReset(HttpReply * rep) { httpReplyClean(rep); - httpReplyInit(rep); + *rep = HttpReply(); } /* absorb: copy the contents of a new reply to the old one, destroy new one */ diff --git a/src/HttpReply.h b/src/HttpReply.h index 73365850e7..77d7c7252c 100644 --- a/src/HttpReply.h +++ b/src/HttpReply.h @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.h,v 1.4 2003/07/14 14:15:56 robertc Exp $ + * $Id: HttpReply.h,v 1.5 2003/07/15 06:50:39 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -86,6 +86,7 @@ class HttpReply public: void *operator new (size_t); void operator delete (void *); + HttpReply(); /* unsupported, writable, may disappear/change in the future */ int hdr_sz; /* sums _stored_ status-line, headers, and */ diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index dd9b681400..dfd7d552b7 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.39 2003/07/11 01:40:34 robertc Exp $ + * $Id: HttpRequest.cc,v 1.40 2003/07/15 06:50:41 robertc Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -40,10 +40,68 @@ static void httpRequestHdrCacheInit(request_t * req); +void * +HttpRequest::operator new(size_t amount) +{ + // Todo: assign private pool. + return static_cast(memAllocate(MEM_REQUEST_T)); +} + +void +HttpRequest::operator delete(void *address) +{ + memFree(address, MEM_REQUEST_T); +} + +void +HttpRequest::deleteSelf() const +{ + delete this; +} + +HttpRequest::HttpRequest() : header(hoRequest) +{ + /* We should initialise these ... */ +#if 0 + method_t method; + protocol_t protocol; + char login[MAX_LOGIN_SZ]; + char host[SQUIDHOSTNAMELEN + 1]; + auth_user_request_t *auth_user_request; + u_short port; + String urlpath; + char *canonical; + int link_count; /* free when zero */ + request_flags flags; + HttpHdrCc *cache_control; + HttpHdrRange *range; + http_version_t http_ver; + time_t ims; + int imslen; + int max_forwards; + /* these in_addr's could probably be sockaddr_in's */ + + struct in_addr client_addr; + + struct in_addr my_addr; + unsigned short my_port; + unsigned short client_port; + HttpHeader header; + ConnStateData::Pointer body_connection; /* used by clientReadBody() */ + int content_length; + HierarchyLogEntry hier; + err_type errType; + char *peer_login; /* Configured peer login:password */ + time_t lastmod; /* Used on refreshes */ + const char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */ + char *peer_domain; /* Configured peer forceddomain */ +#endif +} + request_t * requestCreate(method_t method, protocol_t protocol, const char *aUrlpath) { - request_t *req = static_cast(memAllocate(MEM_REQUEST_T)); + request_t *req = new HttpRequest; req->method = method; req->protocol = protocol; @@ -58,8 +116,6 @@ requestCreate(method_t method, protocol_t protocol, const char *aUrlpath) req->my_addr = no_addr; - httpHeaderInit(&req->header, hoRequest); - httpRequestHdrCacheInit(req); return req; @@ -98,7 +154,7 @@ requestDestroy(request_t * req) req->extacl_log.clean(); - memFree(req, MEM_REQUEST_T); + req->deleteSelf(); } request_t * diff --git a/src/HttpRequest.h b/src/HttpRequest.h index 34e382fd17..c1e8214faa 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.h,v 1.3 2003/07/14 14:15:56 robertc Exp $ + * $Id: HttpRequest.h,v 1.4 2003/07/15 06:50:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -52,10 +52,16 @@ extern int httpRequestHdrAllowedByName(http_hdr_type id); class HttpHdrRange; -class request_t +class HttpRequest { public: + void *operator new(size_t); + void operator delete(void *); + virtual void deleteSelf() const; + HttpRequest(); + virtual ~HttpRequest() {} + bool multipartRangeRequest() const; method_t method; @@ -96,5 +102,6 @@ public: String extacl_log; /* String to be used for access.log purposes */ }; +typedef HttpRequest request_t; #endif /* SQUID_HTTPREQUEST_H */ diff --git a/src/client_side.cc b/src/client_side.cc index c1cd8c3aff..23f2b8369e 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.650 2003/07/13 23:00:09 robertc Exp $ + * $Id: client_side.cc,v 1.651 2003/07/15 06:50:41 robertc Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -837,7 +837,7 @@ clientPackTermBound(String boundary, MemBuf * mb) static void clientPackRangeHdr(const HttpReply * rep, const HttpHdrRangeSpec * spec, String boundary, MemBuf * mb) { - HttpHeader hdr; + HttpHeader hdr(hoReply); Packer p; assert(rep); assert(spec); @@ -848,7 +848,6 @@ clientPackRangeHdr(const HttpReply * rep, const HttpHdrRangeSpec * spec, String memBufPrintf(mb, "\r\n--%s\r\n", boundary.buf()); /* stuff the header with required entries and pack it */ - httpHeaderInit(&hdr, hoReply); if (httpHeaderHas(&rep->header, HDR_CONTENT_TYPE)) httpHeaderPutStr(&hdr, HDR_CONTENT_TYPE, httpHeaderGetStr(&rep->header, HDR_CONTENT_TYPE)); diff --git a/src/fde.h b/src/fde.h index 998455c365..85c311e927 100644 --- a/src/fde.h +++ b/src/fde.h @@ -1,6 +1,6 @@ /* - * $Id: fde.h,v 1.4 2003/06/23 14:13:03 robertc Exp $ + * $Id: fde.h,v 1.5 2003/07/15 06:50:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -39,6 +39,7 @@ class fde { public: + /* NOTE: memset is used on fdes today. 20030715 RBC */ static void DumpStats (StoreEntry *); char const *remoteAddr() const; diff --git a/src/htcp.cc b/src/htcp.cc index 1886d8933e..089f6955b3 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.53 2003/07/14 14:16:00 robertc Exp $ + * $Id: htcp.cc,v 1.54 2003/07/15 06:50:42 robertc Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -729,7 +729,7 @@ htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, struct { htcpStuff stuff; char *pkt; - HttpHeader hdr; + HttpHeader hdr(hoHtcpReply); MemBuf mb; Packer p; ssize_t pktlen; @@ -750,7 +750,6 @@ htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, struct { memBufDefInit(&mb); packerToMemInit(&p, &mb); - httpHeaderInit(&hdr, hoHtcpReply); stuff.S.method = spec->method; stuff.S.uri = spec->uri; stuff.S.version = spec->version; @@ -884,6 +883,9 @@ htcpHandleTst(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) htcpHandleTstResponse(hdr, buf, sz, from); } +HtcpReplyData::HtcpReplyData() : hdr(hoHtcpReply) +{} + static void htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) @@ -899,8 +901,6 @@ htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_i return; } - memset(&htcpReply, '\0', sizeof(htcpReply)); - httpHeaderInit(&htcpReply.hdr, hoHtcpReply); htcpReply.msg_id = hdr->msg_id; debug(31, 3) ("htcpHandleTstResponse: msg_id = %d\n", (int) htcpReply.msg_id); htcpReply.hit = hdr->response ? 0 : 1; @@ -1201,7 +1201,7 @@ htcpQuery(StoreEntry * e, request_t * req, peer * p) ssize_t pktlen; char vbuf[32]; htcpStuff stuff; - HttpHeader hdr; + HttpHeader hdr(hoRequest); Packer pa; MemBuf mb; http_state_flags flags; diff --git a/src/htcp.h b/src/htcp.h index f0cf9ddcc1..4abe81ceca 100644 --- a/src/htcp.h +++ b/src/htcp.h @@ -1,6 +1,6 @@ /* - * $Id: htcp.h,v 1.3 2003/07/14 14:16:00 robertc Exp $ + * $Id: htcp.h,v 1.4 2003/07/15 06:50:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -37,8 +37,11 @@ #if USE_HTCP #include "HttpHeader.h" -struct _htcpReplyData +class HtcpReplyData { + +public: + HtcpReplyData(); int hit; HttpHeader hdr; u_int32_t msg_id; @@ -55,6 +58,14 @@ struct _htcpReplyData cto; }; +typedef class HtcpReplyData htcpReplyData; + +SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const struct sockaddr_in *); +SQUIDCEXTERN void htcpInit(void); +SQUIDCEXTERN void htcpQuery(StoreEntry * e, request_t * req, peer * p); +SQUIDCEXTERN void htcpSocketShutdown(void); +SQUIDCEXTERN void htcpSocketClose(void); + #endif #endif /* SQUID_HTCP_H */ diff --git a/src/http.cc b/src/http.cc index d7e6c3cd12..36140ab180 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.419 2003/07/14 14:16:00 robertc Exp $ + * $Id: http.cc,v 1.420 2003/07/15 06:50:42 robertc Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1125,7 +1125,7 @@ httpBuildRequestHeader(request_t * request, const HttpHeaderEntry *e; String strFwd; HttpHeaderPos pos = HttpHeaderInitPos; - httpHeaderInit(hdr_out, hoRequest); + assert (hdr_out->owner == hoRequest); /* append our IMS header */ if (request->lastmod > -1 && request->method == METHOD_GET) @@ -1486,7 +1486,7 @@ httpBuildRequestPrefix(request_t * request, httpver.major,httpver.minor); /* build and pack headers */ { - HttpHeader hdr; + HttpHeader hdr(hoRequest); Packer p; httpBuildRequestHeader(request, orig_request, entry, &hdr, flags); packerToMemInit(&p, mb); diff --git a/src/main.cc b/src/main.cc index e0b8547923..b87552a1e9 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.383 2003/07/06 15:30:42 hno Exp $ + * $Id: main.cc,v 1.384 2003/07/15 06:50:42 robertc Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -41,6 +41,7 @@ #include "Mem.h" #include "ACLASN.h" #include "ACL.h" +#include "htcp.h" #if USE_WIN32_SERVICE diff --git a/src/protos.h b/src/protos.h index 3af3c2262c..47710d5291 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.482 2003/07/14 14:16:01 robertc Exp $ + * $Id: protos.h,v 1.483 2003/07/15 06:50:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -401,7 +401,6 @@ SQUIDCEXTERN void httpHeaderPutStrf(); SQUIDCEXTERN void httpHeaderInitModule(void); SQUIDCEXTERN void httpHeaderCleanModule(void); /* init/clean */ -SQUIDCEXTERN void httpHeaderInit(HttpHeader * hdr, http_hdr_owner_type owner); SQUIDCEXTERN void httpHeaderClean(HttpHeader * hdr); /* append/update */ SQUIDCEXTERN void httpHeaderAppend(HttpHeader * dest, const HttpHeader * src); @@ -578,10 +577,6 @@ SQUIDCEXTERN void dump_peer_options(StoreEntry *, peer *); SQUIDCEXTERN int peerHTTPOkay(const peer *, request_t *); SQUIDCEXTERN peer *whichPeer(const struct sockaddr_in *from); -#if USE_HTCP - -SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const struct sockaddr_in *); -#endif SQUIDCEXTERN void netdbInit(void); @@ -948,12 +943,6 @@ SQUIDCEXTERN int getMyPort(void); SQUIDCEXTERN char *strwordtok(char *buf, char **t); SQUIDCEXTERN void strwordquote(MemBuf * mb, const char *str); -#if USE_HTCP -SQUIDCEXTERN void htcpInit(void); -SQUIDCEXTERN void htcpQuery(StoreEntry * e, request_t * req, peer * p); -SQUIDCEXTERN void htcpSocketShutdown(void); -SQUIDCEXTERN void htcpSocketClose(void); -#endif /* diff --git a/src/structs.h b/src/structs.h index 8acf326ff3..bbae3e78da 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.472 2003/07/14 14:16:02 robertc Exp $ + * $Id: structs.h,v 1.473 2003/07/15 06:50:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -996,6 +996,7 @@ struct _HierarchyLogEntry struct _AccessLogEntry { + /* NB: memset is used on AccessLogEntries as at 20030715 RBC */ const char *url; struct diff --git a/src/tunnel.cc b/src/tunnel.cc index a7c7bdde41..9a2485d808 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.142 2003/07/10 11:04:07 robertc Exp $ + * $Id: tunnel.cc,v 1.143 2003/07/15 06:50:43 robertc Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -639,7 +639,7 @@ sslProxyConnected(int fd, void *data) { SslStateData *sslState = (SslStateData *)data; MemBuf mb; - HttpHeader hdr_out; + HttpHeader hdr_out(hoRequest); Packer p; http_state_flags flags; debug(26, 3) ("sslProxyConnected: FD %d sslState=%p\n", fd, sslState); diff --git a/src/typedefs.h b/src/typedefs.h index aadfaf4eb0..90d5690112 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.165 2003/07/14 14:16:02 robertc Exp $ + * $Id: typedefs.h,v 1.166 2003/07/15 06:50:43 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -199,7 +199,7 @@ typedef struct _header_mangler header_mangler; typedef struct _body_size body_size; -class request_t; +typedef struct HttpRequest request_t; typedef struct _AccessLogEntry AccessLogEntry; @@ -368,11 +368,6 @@ typedef char HttpHeaderMask[12]; /* a common objPackInto interface; used by debugObj */ typedef void (*ObjPackMethod) (void *obj, Packer * p); -#if USE_HTCP - -typedef struct _htcpReplyData htcpReplyData; -#endif - typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist * args); typedef int STDIRSELECT(const StoreEntry *);