]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Class cleanup - resulting from addressing a latent segfault.
authorrobertc <>
Mon, 1 Sep 2003 09:49:37 +0000 (09:49 +0000)
committerrobertc <>
Mon, 1 Sep 2003 09:49:37 +0000 (09:49 +0000)
Keywords:

Move httpMsgIsPersistent delcaration to HttpHeader
Rename http_version_t to HttpVersion, and make a class.
Remove httpBuildVersion - use HttpVersion constructor.
Move HttpVersion to it's own file.
Move HttpStatusLine to it's own file and make a class.
Move AccessLogEntry to it's own file, and make a class.
Remove memset() use against AccessLogEntry.

34 files changed:
src/AccessLogEntry.h [new file with mode: 0644]
src/HttpHeader.h
src/HttpMsg.cc
src/HttpReply.cc
src/HttpReply.h
src/HttpRequest.cc
src/HttpRequest.h
src/HttpStatusLine.cc
src/HttpStatusLine.h [new file with mode: 0644]
src/HttpVersion.h [new file with mode: 0644]
src/Makefile.am
src/access_log.cc
src/cache_cf.cc
src/cache_manager.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/client_side_request.h
src/errorpage.cc
src/fs/coss/store_dir_coss.cc
src/ftp.cc
src/http.cc
src/icp_v2.cc
src/internal.cc
src/main.cc
src/mime.cc
src/net_db.cc
src/protos.h
src/store.cc
src/store_digest.cc
src/structs.h
src/typedefs.h
src/urn.cc
src/whois.cc

diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h
new file mode 100644 (file)
index 0000000..196981e
--- /dev/null
@@ -0,0 +1,149 @@
+
+/*
+ * $Id: AccessLogEntry.h,v 1.1 2003/09/01 03:49:37 robertc Exp $
+ *
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
+ */
+
+#ifndef SQUID_HTTPACCESSLOGENTRY_H
+#define SQUID_HTTPACCESSLOGENTRY_H
+
+#include "HttpVersion.h"
+
+class AccessLogEntry
+{
+
+public:
+    AccessLogEntry() : url(NULL) , reply(NULL), request(NULL) {}
+
+    const char *url;
+
+    class HttpDetails
+    {
+
+    public:
+        HttpDetails() : method(METHOD_NONE), code(0), content_type(NULL) {}
+
+        method_t method;
+        int code;
+        const char *content_type;
+        HttpVersion version;
+    }
+
+    http;
+
+    class ICPDetails
+    {
+
+    public:
+        ICPDetails() : opcode(ICP_INVALID) {}
+
+        icp_opcode opcode;
+    }
+
+    icp;
+
+    class CacheDetails
+    {
+
+    public:
+        CacheDetails() : size(0),
+                highOffset(0),
+                objectSize(0),
+                code (LOG_TAG_NONE),
+                msec(0),
+                rfc931 (NULL),
+                authuser (NULL),
+                extuser(NULL)
+#if USE_SSL
+                ,ssluser(NULL)
+#endif
+        {
+            memset(&caddr, '\0', sizeof(caddr));
+        }
+
+        struct in_addr caddr;
+        size_t size;
+        off_t highOffset;
+        size_t objectSize;
+        log_type code;
+        int msec;
+        const char *rfc931;
+        const char *authuser;
+#if USE_SSL
+
+        const char *ssluser;
+#endif
+
+        const char *extuser;
+
+    }
+
+    cache;
+
+    class Headers
+    {
+
+    public:
+        Headers() : request(NULL), reply(NULL) {}
+
+        char *request;
+        char *reply;
+    }
+
+    headers;
+
+    class Private
+    {
+
+    public:
+        Private() : method_str(NULL) {}
+
+        const char *method_str;
+    }
+
+    _private;
+    HierarchyLogEntry hier;
+    HttpReply *reply;
+    HttpRequest *request;
+};
+
+/* Should be in 'AccessLog.h' as the driver */
+SQUIDCEXTERN void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
+SQUIDCEXTERN void accessLogRotate(void);
+SQUIDCEXTERN void accessLogClose(void);
+SQUIDCEXTERN void accessLogInit(void);
+SQUIDCEXTERN void accessLogFreeMemory(AccessLogEntry * aLogEntry);
+SQUIDCEXTERN const char *accessLogTime(time_t);
+SQUIDCEXTERN int accessLogParseLogFormat(logformat_token ** fmt, char *def);
+SQUIDCEXTERN void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
+SQUIDCEXTERN void accessLogFreeLogFormat(logformat_token ** fmt);
+
+#endif /* SQUID_HTTPACCESSLOGENTRY_H */
index 0cc50961ba1fe6cf5260b9548370ea90205e9b18..43a9fd00f60f61022e6fa8f375139a6bae676aca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.h,v 1.6 2003/07/15 06:50:39 robertc Exp $
+ * $Id: HttpHeader.h,v 1.7 2003/09/01 03:49:37 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -46,12 +46,15 @@ struct _HttpHeaderFieldAttrs
     field_type type;
 };
 
+class HttpVersion;
+
 extern int httpHeaderParseQuotedString (const char *start, String *val);
 extern void httpHeaderPutSc(HttpHeader *hdr, const HttpHdrSc *sc);
 extern HttpHdrSc *httpHeaderGetSc(const HttpHeader *hdr);
 SQUIDCEXTERN void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, ssize_t);
 extern int httpHeaderHasListMember(const HttpHeader * hdr, http_hdr_type id, const char *member, const char separator);
 SQUIDCEXTERN void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);
+int httpMsgIsPersistent(HttpVersion const &http_ver, const HttpHeader * hdr);
 
 class HttpHeader
 {
index 574be91d383ee659a848966d051007b696b616e2..11ec84edef95f084a6565fe9220aa639a8317dbb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpMsg.cc,v 1.12 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpMsg.cc,v 1.13 2003/09/01 03:49:37 robertc Exp $
  *
  * DEBUG: section 74    HTTP Message
  * AUTHOR: Alex Rousskov
@@ -34,7 +34,7 @@
  */
 
 #include "squid.h"
-
+#include "HttpVersion.h"
 
 /* find end of headers */
 int
@@ -99,7 +99,7 @@ httpMsgIsolateHeaders(const char **parse_start, const char **blk_start, const ch
 /* returns true if connection should be "persistent"
  * after processing this message */
 int
-httpMsgIsPersistent(http_version_t http_ver, const HttpHeader * hdr)
+httpMsgIsPersistent(HttpVersion const &http_ver, const HttpHeader * hdr)
 {
     if ((http_ver.major >= 1) && (http_ver.minor >= 1)) {
         /*
index 679bf9b59bc1385568fdbd6a8d26cc00c41443cc..33b8d285e2a423688c016eb86d118bf0dc3cf6f8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.cc,v 1.62 2003/07/15 06:50:39 robertc Exp $
+ * $Id: HttpReply.cc,v 1.63 2003/09/01 03:49:37 robertc Exp $
  *
  * DEBUG: section 58    HTTP Reply (Response)
  * AUTHOR: Alex Rousskov
@@ -207,7 +207,7 @@ httpReplySwapOut(HttpReply * rep, StoreEntry * e)
 }
 
 MemBuf
-httpPackedReply(http_version_t ver, http_status status, const char *ctype,
+httpPackedReply(HttpVersion ver, http_status status, const char *ctype,
                 int clen, time_t lmt, time_t expires)
 {
     HttpReply *rep = httpReplyCreate();
@@ -226,7 +226,6 @@ httpReplyMake304 (const HttpReply * rep)
     HttpReply *rv;
     int t;
     HttpHeaderEntry *e;
-    http_version_t ver;
     assert(rep);
 
     rv = httpReplyCreate ();
@@ -238,7 +237,7 @@ httpReplyMake304 (const HttpReply * rep)
     /* rv->cache_control */
     /* rv->content_range */
     /* rv->keep_alive */
-    httpBuildVersion(&ver, 1, 0);
+    HttpVersion ver(1,0);
     httpStatusLineSet(&rv->sline, ver,
                       HTTP_NOT_MODIFIED, "");
 
@@ -266,7 +265,7 @@ httpPacked304Reply(const HttpReply * rep)
 }
 
 void
-httpReplySetHeaders(HttpReply * reply, http_version_t ver, http_status status, const char *reason,
+httpReplySetHeaders(HttpReply * reply, HttpVersion ver, http_status status, const char *reason,
                     const char *ctype, int clen, time_t lmt, time_t expires)
 {
     HttpHeader *hdr;
@@ -305,9 +304,8 @@ void
 httpRedirectReply(HttpReply * reply, http_status status, const char *loc)
 {
     HttpHeader *hdr;
-    http_version_t ver;
     assert(reply);
-    httpBuildVersion(&ver, 1, 0);
+    HttpVersion ver(1,0);
     httpStatusLineSet(&reply->sline, ver, status, httpStatusString(status));
     hdr = &reply->header;
     httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
index 77d7c7252cc3283e3332ec244e23e8783d1e47e9..d69bafeacd4688ba4744efd30f044dee7244d348 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.h,v 1.5 2003/07/15 06:50:39 robertc Exp $
+ * $Id: HttpReply.h,v 1.6 2003/09/01 03:49:37 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -36,6 +36,7 @@
 
 #include "typedefs.h"
 #include "HttpHeader.h"
+#include "HttpStatusLine.h"
 
 /* Http Reply */
 extern void httpReplyInitModule(void);
@@ -56,10 +57,10 @@ extern MemBuf httpReplyPack(const HttpReply * rep);
 /* swap: create swap-based packer, pack, destroy packer */
 extern void httpReplySwapOut(HttpReply * rep, StoreEntry * e);
 /* set commonly used info with one call */
-extern void httpReplySetHeaders(HttpReply * rep, http_version_t ver, http_status status,
+extern void httpReplySetHeaders(HttpReply * rep, HttpVersion ver, http_status status,
                                     const char *reason, const char *ctype, int clen, time_t lmt, time_t expires);
 /* do everything in one call: init, set, pack, clean, return MemBuf */
-extern MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype,
+extern MemBuf httpPackedReply(HttpVersion ver, http_status status, const char *ctype,
                                   int clen, time_t lmt, time_t expires);
 /* construct 304 reply and pack it into MemBuf, return MemBuf */
 extern MemBuf httpPacked304Reply(const HttpReply * rep);
index 9ddabffad3c1d08a6868da85d9cdb73b222ba240..6eaed999b7bc7e2068eb2464510a1c5b891042e3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.cc,v 1.44 2003/08/14 12:15:04 robertc Exp $
+ * $Id: HttpRequest.cc,v 1.45 2003/09/01 03:49:37 robertc Exp $
  *
  * DEBUG: section 73    HTTP Request
  * AUTHOR: Duane Wessels
@@ -76,7 +76,7 @@ HttpRequest::HttpRequest()  : header(hoRequest)
     request_flags flags;
     HttpHdrCc *cache_control;
     HttpHdrRange *range;
-    http_version_t http_ver;
+    HttpVersion http_ver;
     time_t ims;
     int imslen;
     int max_forwards;
index 10224f4f272b46588777f6558d9a1a9cf5883507..bc3333e8a702c4408fc1c2e5025e484fa46da176 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.h,v 1.7 2003/08/10 11:00:40 robertc Exp $
+ * $Id: HttpRequest.h,v 1.8 2003/09/01 03:49:37 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -37,6 +37,7 @@
 #include "typedefs.h"
 #include "HttpHeader.h"
 #include "client_side.h"
+#include "HttpVersion.h"
 
 /*  Http Request */
 extern HttpRequest *requestCreate(method_t, protocol_t, const char *urlpath);
@@ -75,7 +76,7 @@ public:
     request_flags flags;
     HttpHdrCc *cache_control;
     HttpHdrRange *range;
-    http_version_t http_ver;
+    HttpVersion http_ver;
     time_t ims;
     int imslen;
     int max_forwards;
index 844b2cd773b90a953f353ef6cd490fdadc889d68..d65082e875047a796cd14df6744e688d4d58ea4e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpStatusLine.cc,v 1.27 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpStatusLine.cc,v 1.28 2003/09/01 03:49:37 robertc Exp $
  *
  * DEBUG: section 57    HTTP Status-line
  * AUTHOR: Alex Rousskov
@@ -34,7 +34,7 @@
  */
 
 #include "squid.h"
-
+#include "HttpStatusLine.h"
 
 /* local constants */
 const char *HttpStatusLineFormat = "HTTP/%d.%d %3d %s\r\n";
@@ -42,22 +42,20 @@ const char *HttpStatusLineFormat = "HTTP/%d.%d %3d %s\r\n";
 void
 httpStatusLineInit(HttpStatusLine * sline)
 {
-    http_version_t version;
-    httpBuildVersion(&version, 0, 0);
+    HttpVersion version;
     httpStatusLineSet(sline, version, HTTP_STATUS_NONE, NULL);
 }
 
 void
 httpStatusLineClean(HttpStatusLine * sline)
 {
-    http_version_t version;
-    httpBuildVersion(&version, 0, 0);
+    HttpVersion version;
     httpStatusLineSet(sline, version, HTTP_INTERNAL_SERVER_ERROR, NULL);
 }
 
 /* set values */
 void
-httpStatusLineSet(HttpStatusLine * sline, http_version_t version, http_status status, const char *reason)
+httpStatusLineSet(HttpStatusLine * sline, HttpVersion version, http_status status, const char *reason)
 {
     assert(sline);
     sline->version = version;
diff --git a/src/HttpStatusLine.h b/src/HttpStatusLine.h
new file mode 100644 (file)
index 0000000..11ce341
--- /dev/null
@@ -0,0 +1,64 @@
+
+/*
+ * $Id: HttpStatusLine.h,v 1.1 2003/09/01 03:49:37 robertc Exp $
+ *
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
+ */
+
+#ifndef SQUID_HTTPSTATUSLINE_H
+#define SQUID_HTTPSTATUSLINE_H
+
+#include "HttpVersion.h"
+
+class HttpStatusLine
+{
+
+public:
+    /* public, read only */
+    HttpVersion version;
+    const char *reason;                /* points to a _constant_ string (default or supplied), never free()d */
+    http_status status;
+};
+
+/* init/clean */
+SQUIDCEXTERN void httpStatusLineInit(HttpStatusLine * sline);
+SQUIDCEXTERN void httpStatusLineClean(HttpStatusLine * sline);
+/* set/get values */
+SQUIDCEXTERN void httpStatusLineSet(HttpStatusLine * sline, HttpVersion version,
+                                    http_status status, const char *reason);
+SQUIDCEXTERN const char *httpStatusLineReason(const HttpStatusLine * sline);
+/* parse/pack */
+/* parse a 0-terminating buffer and fill internal structires; returns true on success */
+SQUIDCEXTERN int httpStatusLineParse(HttpStatusLine * sline, const char *start,
+                                     const char *end);
+/* pack fields using Packer */
+SQUIDCEXTERN void httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p);
+
+#endif /* SQUID_HTTPSTATUSLINE_H */
diff --git a/src/HttpVersion.h b/src/HttpVersion.h
new file mode 100644 (file)
index 0000000..de26ff7
--- /dev/null
@@ -0,0 +1,58 @@
+
+/*
+ * $Id: HttpVersion.h,v 1.1 2003/09/01 03:49:37 robertc Exp $
+ *
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
+ */
+
+#ifndef SQUID_HTTPVERSION_H
+#define SQUID_HTTPVERSION_H
+
+class HttpVersion
+{
+
+public:
+    HttpVersion()
+    {
+        major = 0;
+        minor = 0;
+    }
+
+    HttpVersion(unsigned int aMajor, unsigned int aMinor)
+    {
+        major = aMajor;
+        minor = aMinor;
+    }
+
+    unsigned int major;
+    unsigned int minor;
+};
+
+#endif /* SQUID_HTTPVERSION_H */
index b1b0f27c14cf70173ea74d94b6dec36134f8a28f..10d4ff1ecf9bfea7a77b256f2527842296fcf71e 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.89 2003/08/14 23:21:51 robertc Exp $
+#  $Id: Makefile.am,v 1.90 2003/09/01 03:49:37 robertc Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -293,6 +293,7 @@ squid_ACLSOURCES = \
 
 squid_SOURCES = \
        access_log.cc \
+       AccessLogEntry.h \
        acl.cc \
        ACL.h \
        ACLChecklist.cc \
@@ -355,6 +356,7 @@ squid_SOURCES = \
        http.cc \
        http.h \
        HttpStatusLine.cc \
+       HttpStatusLine.h \
        HttpHdrCc.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -371,6 +373,7 @@ squid_SOURCES = \
        HttpReply.h \
        HttpRequest.cc \
        HttpRequest.h \
+       HttpVersion.h \
        icmp.cc \
        ICP.h \
        icp_v2.cc \
index b048a314b2def3e582504c27e6ac035823d601cb..5e6396ce8437b5abb32da3cc14c2442336ed7791 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: access_log.cc,v 1.94 2003/08/20 13:34:41 hno Exp $
+ * $Id: access_log.cc,v 1.95 2003/09/01 03:49:37 robertc Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -35,6 +35,7 @@
 
 
 #include "squid.h"
+#include "AccessLogEntry.h"
 
 // Store.h Required by configuration directives parsing/dumping only
 #include "Store.h"
index 452b91f2f603609f58a9aef2a4e9f836c3d96a5d..79a300c39ca53f0181f5df7983f0a255fc6e3063 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.449 2003/08/31 21:20:08 robertc Exp $
+ * $Id: cache_cf.cc,v 1.450 2003/09/01 03:49:37 robertc Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -2987,6 +2987,8 @@ strtok_again:
     }
 }
 
+#include "AccessLogEntry.h"
+/* TODO: split out parsing somehow ...*/
 static void
 parse_logformat(logformat ** logformat_definitions)
 {
index 4785ad82ce7d52639f52e651ba003d72d25f739f..fb04c39e689d75fd9befb72c924d0df4ac914505 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_manager.cc,v 1.30 2003/08/10 11:00:42 robertc Exp $
+ * $Id: cache_manager.cc,v 1.31 2003/09/01 03:49:38 robertc Exp $
  *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
@@ -316,9 +316,8 @@ cachemgrStart(int fd, HttpRequest * request, StoreEntry * entry)
         storeBuffer(entry);
 
     {
-        http_version_t version;
+        HttpVersion version(1,0);
         HttpReply *rep = httpReplyCreate();
-        httpBuildVersion(&version, 1, 0);
         httpReplySetHeaders(rep,
                             version,
                             HTTP_OK,
index 210abd102adc09580ac4e3ea7ddeb7d6f776b84b..5724f4c6eb43caf916765e279c3db80962287a4f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.657 2003/08/14 12:15:04 robertc Exp $
+ * $Id: client_side.cc,v 1.658 2003/09/01 03:49:38 robertc Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -153,7 +153,7 @@ static char *findTrailingHTTPVersion(char *uriAndHTTPVersion);
 #if UNUSED_CODE
 static void trimTrailingSpaces(char *aString, size_t len);
 #endif
-static ClientSocketContext *parseURIandHTTPVersion(char **url_p, http_version_t * http_ver_p, ConnStateData::Pointer& conn, char *http_version_str);
+static ClientSocketContext *parseURIandHTTPVersion(char **url_p, HttpVersion * http_ver_p, ConnStateData::Pointer& conn, char *http_version_str);
 static void setLogUri(clientHttpRequest * http, char const *uri);
 static int connReadWasError(ConnStateData::Pointer& conn, comm_err_t, int size, int xerrno);
 static int connFinishedWithConn(ConnStateData::Pointer& conn, int size);
@@ -640,8 +640,7 @@ clientSetKeepaliveFlag(clientHttpRequest * http)
     if (!Config.onoff.client_pconns)
         request->flags.proxy_keepalive = 0;
     else {
-        http_version_t http_ver;
-        httpBuildVersion(&http_ver, 1, 0);
+        HttpVersion http_ver(1,0);
         /* we are HTTP/1.0, no matter what the client requests... */
 
         if (httpMsgIsPersistent(http_ver, req_hdr))
@@ -1601,7 +1600,7 @@ trimTrailingSpaces(char *aString, size_t len)
 #endif
 
 static ClientSocketContext *
-parseURIandHTTPVersion(char **url_p, http_version_t * http_ver_p,
+parseURIandHTTPVersion(char **url_p, HttpVersion * http_ver_p,
                        ConnStateData::Pointer & conn, char *http_version_str)
 {
     char *url;
@@ -1643,7 +1642,7 @@ parseURIandHTTPVersion(char **url_p, http_version_t * http_ver_p,
         debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n",
                       http_ver_p->major, http_ver_p->minor);
     } else {
-        httpBuildVersion(http_ver_p, 0, 9);    /* wild guess */
+        *http_ver_p = HttpVersion(0,9);        /* wild guess */
     }
 
     return NULL;
@@ -1652,7 +1651,7 @@ parseURIandHTTPVersion(char **url_p, http_version_t * http_ver_p,
 /* Utility function to perform part of request parsing */
 static ClientSocketContext *
 clientParseHttpRequestLine(char *reqline, ConnStateData::Pointer &conn,
-                           method_t * method_p, char **url_p, http_version_t * http_ver_p, char * http_version_str)
+                           method_t * method_p, char **url_p, HttpVersion * http_ver_p, char * http_version_str)
 {
     ClientSocketContext *result = NULL;
     /* XXX: This sequence relies on strtok() */
@@ -1798,7 +1797,7 @@ parseHttpRequest(ConnStateData::Pointer & conn, method_t * method_p,
     char *url = NULL;
     char *req_hdr = NULL;
     char *t;
-    http_version_t http_ver;
+    HttpVersion http_ver;
     char *end;
     size_t header_sz;          /* size of headers, not including first line */
     size_t prefix_sz;          /* size of whole request (req-line + headers) */
index e089268ab45baf58a8283d52ded8c42bef943034..6850a4762d99253394413f730622dfd9bfd570ee 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.66 2003/08/19 22:30:36 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.67 2003/09/01 03:49:38 robertc Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -973,7 +973,6 @@ clientReplyContext::purgeDoPurgeHead(StoreEntry *newEntry)
     }
 
     HttpReply *r;
-    http_version_t version;
 
     /* And for Vary, release the base URI if none of the headers was included in the request */
 
@@ -1011,7 +1010,7 @@ clientReplyContext::purgeDoPurgeHead(StoreEntry *newEntry)
 
     r = httpReplyCreate();
 
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1,0);
 
     httpReplySetHeaders(r, version, purgeStatus, NULL, NULL, 0, 0, -1);
 
@@ -1024,7 +1023,6 @@ void
 clientReplyContext::traceReply(clientStreamNode * node)
 {
     HttpReply *rep;
-    http_version_t version;
     clientStreamNode *next = (clientStreamNode *)node->node.next->data;
     StoreIOBuffer tempBuffer;
     assert(http->request->max_forwards == 0);
@@ -1037,7 +1035,7 @@ clientReplyContext::traceReply(clientStreamNode * node)
     storeReleaseRequest(http->storeEntry());
     storeBuffer(http->storeEntry());
     rep = httpReplyCreate();
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1,0);
     httpReplySetHeaders(rep, version, HTTP_OK, NULL, "text/plain",
                         httpRequestPrefixLen(http->request), 0, squid_curtime);
     httpReplySwapOut(rep, http->storeEntry());
@@ -1457,7 +1455,7 @@ clientReplyContext::buildReply(const char *buf, size_t size)
     }
 
     /* enforce 1.0 reply version */
-    httpBuildVersion(&holdingReply->sline.version, 1, 0);
+    holdingReply->sline.version = HttpVersion(1,0);
 
     /* do header conversions */
     buildReplyHeader();
index d4f102d1c6b25eef2cefa5cd35664b7b6eaef53d..565496a66e9b727c28bdd24c69eb46e38dcbaf1b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.32 2003/08/13 00:17:26 robertc Exp $
+ * $Id: client_side_request.cc,v 1.33 2003/09/01 03:49:38 robertc Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -276,8 +276,7 @@ clientBeginRequest(method_t method, char const *url, CSCB * streamcallback,
                    char *tailbuf, size_t taillen)
 {
     size_t url_sz;
-    http_version_t http_ver =
-        {1, 0};
+    HttpVersion http_ver (1, 0);
     clientHttpRequest *http = new ClientHttpRequest;
     HttpRequest *request;
     StoreIOBuffer tempBuffer;
index 92a07ee19e4b3f64b10b6f106782bebc75c62626..d874fd3319cb39c8f9f2fed33804745385a08493 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.h,v 1.18 2003/08/13 00:17:26 robertc Exp $
+ * $Id: client_side_request.h,v 1.19 2003/09/01 03:49:38 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -37,6 +37,7 @@
 #include "HttpHeader.h"
 #include "clientStream.h"
 #include "client_side.h"
+#include "AccessLogEntry.h"
 
 /* client_side_request.c - client side request related routines (pure logic) */
 extern int clientBeginRequest(method_t, char const *, CSCB *, CSD *, ClientStreamData, HttpHeader const *, char *, size_t);
@@ -95,7 +96,7 @@ public:
     log_type logType;
 
     struct timeval start;
-    http_version_t http_ver;
+    HttpVersion http_ver;
     AccessLogEntry al;
 
     struct
index fe84e8a906668c0cd1fa0fb21dc2b32f19a601f5..6a4ee48883ae83a178ba1493144d08a138a6062f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.190 2003/08/10 11:00:42 robertc Exp $
+ * $Id: errorpage.cc,v 1.191 2003/09/01 03:49:38 robertc Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -825,9 +825,8 @@ errorBuildReply(ErrorState * err)
 {
     HttpReply *rep = httpReplyCreate();
     const char *name = errorPageName(err->page_id);
-    http_version_t version;
     /* no LMT for error pages; error pages expire immediately */
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1, 0);
 
     if (strchr(name, ':')) {
         /* Redirection */
index e7c7311661d8414c66ab69888a6b8f893c44ae0a..b4084669241f8e301a64b98f7075ee0ffcac7de2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.50 2003/08/31 21:20:10 robertc Exp $
+ * $Id: store_dir_coss.cc,v 1.51 2003/09/01 03:49:42 robertc Exp $
  *
  * DEBUG: section 47    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -841,6 +841,8 @@ CossSwapDir::parse(int anIndex, char *aPath)
 
     max_size = size;
 
+    parseOptions(0);
+
     /* Enforce maxobjsize being set to something */
     if (max_objsize == -1)
         fatal("COSS requires max-size to be set to something other than -1!\n");
index 2965ae73b28d6932fe8f7753cd90f626749e8b08..988630cf21fc21dc26515865134ba6299e037fca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.353 2003/08/10 11:00:43 robertc Exp $
+ * $Id: ftp.cc,v 1.354 2003/09/01 03:49:38 robertc Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -3048,7 +3048,6 @@ ftpAppendSuccessHeader(FtpStateData * ftpState)
     const char *t = NULL;
     StoreEntry *e = ftpState->entry;
     HttpReply *reply = httpReplyCreate ();
-    http_version_t version;
 
     if (ftpState->flags.http_header_sent)
         return;
@@ -3091,13 +3090,13 @@ ftpAppendSuccessHeader(FtpStateData * ftpState)
         HttpHdrRangeSpec range_spec;
         range_spec.offset = ftpState->restarted_offset;
         range_spec.length = ftpState->size - ftpState->restarted_offset;
-        httpBuildVersion(&version, 1, 0);
+        HttpVersion version(1, 0);
         httpReplySetHeaders(reply, version, HTTP_PARTIAL_CONTENT, "Gatewaying",
                             mime_type, ftpState->size - ftpState->restarted_offset, ftpState->mdtm, -2);
         httpHeaderAddContRange(&reply->header, range_spec, ftpState->size);
     } else {
         /* Full reply */
-        httpBuildVersion(&version, 1, 0);
+        HttpVersion version(1, 0);
         httpReplySetHeaders(reply, version, HTTP_OK, "Gatewaying",
                             mime_type, ftpState->size, ftpState->mdtm, -2);
     }
index 3d0b2467ff8bd7a3ef829facf8725e6fb7fda1b1..1f88ba08fbfdd1529033fad4e4601bdfb3a753d4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.426 2003/08/10 11:00:43 robertc Exp $
+ * $Id: http.cc,v 1.427 2003/09/01 03:49:38 robertc Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -1492,8 +1492,7 @@ httpBuildRequestPrefix(HttpRequest * request,
                        http_state_flags flags)
 {
     const int offset = mb->size;
-    http_version_t httpver;
-    httpBuildVersion(&httpver, 1, 0);
+    HttpVersion httpver(1, 0);
     memBufPrintf(mb, "%s %s HTTP/%d.%d\r\n",
                  RequestMethodStr[request->method],
                  request->urlpath.size() ? request->urlpath.buf() : "/",
@@ -1733,7 +1732,7 @@ httpSendRequestEntity(int fd, char *bufnotused, size_t size, comm_err_t errflag,
 }
 
 void
-httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor)
+httpBuildVersion(HttpVersion * version, unsigned int major, unsigned int minor)
 {
     version->major = major;
     version->minor = minor;
index 59192b820f639e1b28c0dcf5ac95f8ddec2899e2..8fdbc53e53388d83a8d0ee2edaaad3426054e255 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icp_v2.cc,v 1.82 2003/08/10 11:00:43 robertc Exp $
+ * $Id: icp_v2.cc,v 1.83 2003/09/01 03:49:39 robertc Exp $
  *
  * DEBUG: section 12    Internet Cache Protocol
  * AUTHOR: Duane Wessels
@@ -40,6 +40,7 @@
 #include "HttpRequest.h"
 #include "ACLChecklist.h"
 #include "ACL.h"
+#include "AccessLogEntry.h"
 
 static void icpLogIcp(struct in_addr, log_type, int, const char *, int);
 
@@ -169,8 +170,6 @@ icpLogIcp(struct in_addr caddr, log_type logcode, int len, const char *url, int
     if (!Config.onoff.log_udp)
         return;
 
-    memset(&al, '\0', sizeof(al));
-
     al.icp.opcode = ICP_QUERY;
 
     al.url = url;
index f594c47d1c9d96c0dc7114dc1f4055c3b29c079f..9651d2779e37f823d13e6a6ed8ae7ac5bd6e96b3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: internal.cc,v 1.29 2003/08/10 11:00:43 robertc Exp $
+ * $Id: internal.cc,v 1.30 2003/09/01 03:49:39 robertc Exp $
  *
  * DEBUG: section 76    Internal Squid Object handling
  * AUTHOR: Duane, Alex, Henrik
@@ -47,7 +47,6 @@ internalStart(HttpRequest * request, StoreEntry * entry)
 {
     ErrorState *err;
     const char *upath = request->urlpath.buf();
-    http_version_t version;
     debug(76, 3) ("internalStart: %s requesting '%s'\n",
                   inet_ntoa(request->client_addr), upath);
 
@@ -61,7 +60,7 @@ internalStart(HttpRequest * request, StoreEntry * entry)
         const char *msgbuf = "This cache does not suport Cache Digests.\n";
 #endif
 
-        httpBuildVersion(&version, 1, 0);
+        HttpVersion version(1, 0);
         HttpReply *reply = httpReplyCreate ();
         httpReplySetHeaders(reply,
                             version,
index 7e11240ddca264dbb6003f403ccb60ce936742d9..a54f46abd94ee9c9d898e7cb9fff4d1839189ed3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.387 2003/08/31 01:22:05 robertc Exp $
+ * $Id: main.cc,v 1.388 2003/09/01 03:49:39 robertc Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -34,6 +34,7 @@
  */
 
 #include "squid.h"
+#include "AccessLogEntry.h"
 #include "authenticate.h"
 #include "Store.h"
 #include "ICP.h"
index dc7ee8c9fcc28248d97dd62426c48f366e91e62d..74fe6277ae0b639d05a07ef03f6bdaf5d244bebb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.113 2003/08/10 11:00:43 robertc Exp $
+ * $Id: mime.cc,v 1.114 2003/09/01 03:49:39 robertc Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -570,9 +570,6 @@ MimeIcon::created (StoreEntry *newEntry)
 
     char *buf;
 
-    http_version_t version;
-
-
     snprintf(path, MAXPATHLEN, "%s/%s", Config.icons.directory, icon);
 
     fd = file_open(path, O_RDONLY | O_BINARY);
@@ -606,7 +603,7 @@ MimeIcon::created (StoreEntry *newEntry)
 
     HttpReply *reply = httpReplyCreate();
 
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1, 0);
 
     httpReplySetHeaders(reply, version, HTTP_OK, NULL,
                         mimeGetContentType(icon), (int) sb.st_size, sb.st_mtime, -1);
index 42492a029bba3b382989f520a34c73f2f7aec06f..302caf51299b7cd6056e95f0cddc2fd030456d50 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.172 2003/08/10 11:00:44 robertc Exp $
+ * $Id: net_db.cc,v 1.173 2003/09/01 03:49:39 robertc Exp $
  *
  * DEBUG: section 38    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -1187,7 +1187,6 @@ void
 netdbBinaryExchange(StoreEntry * s)
 {
     HttpReply *reply = httpReplyCreate();
-    http_version_t version;
 #if USE_ICMP
 
     netdbEntry *n;
@@ -1198,7 +1197,7 @@ netdbBinaryExchange(StoreEntry * s)
 
     struct in_addr addr;
     storeBuffer(s);
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1, 0);
     httpReplySetHeaders(reply, version, HTTP_OK, "OK",
                         NULL, -1, squid_curtime, -2);
     httpReplySwapOut(reply, s);
@@ -1258,7 +1257,7 @@ netdbBinaryExchange(StoreEntry * s)
     memFree(buf, MEM_4K_BUF);
 #else
 
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1,0);
     httpReplySetHeaders(reply, version, HTTP_BAD_REQUEST, "Bad Request",
                         NULL, -1, squid_curtime, -2);
     httpReplySwapOut(reply, s);
@@ -1295,7 +1294,7 @@ netdbExchangeStart(void *data)
 
     requestLink(ex->r);
     assert(NULL != ex->r);
-    httpBuildVersion(&ex->r->http_ver, 1, 0);
+    ex->r->http_ver = HttpVersion(1,0);
     ex->connstate = STATE_HEADER;
     ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
     ex->buf_sz = NETDB_REQBUF_SZ;
index ff8c5c6b2b63f152e0f4c82f5df2ddcf50e0a279..41a389f599dd885f0311460f87e0986f5bbc7b5a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.491 2003/08/17 13:42:04 robertc Exp $
+ * $Id: protos.h,v 1.492 2003/09/01 03:49:39 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
 #ifndef SQUID_PROTOS_H
 #define SQUID_PROTOS_H
 
-SQUIDCEXTERN void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
-SQUIDCEXTERN void accessLogRotate(void);
-SQUIDCEXTERN void accessLogClose(void);
-SQUIDCEXTERN void accessLogInit(void);
-SQUIDCEXTERN void accessLogFreeMemory(AccessLogEntry * aLogEntry);
-SQUIDCEXTERN const char *accessLogTime(time_t);
-SQUIDCEXTERN int accessLogParseLogFormat(logformat_token ** fmt, char *def);
-SQUIDCEXTERN void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
-SQUIDCEXTERN void accessLogFreeLogFormat(logformat_token ** fmt);
 SQUIDCEXTERN void hierarchyNote(HierarchyLogEntry *, hier_code, const char *);
 #if FORW_VIA_DB
 SQUIDCEXTERN void fvdbCountVia(const char *key);
@@ -304,27 +295,12 @@ SQUIDCEXTERN void httpAnonInitModule(void);
 SQUIDCEXTERN int httpAnonHdrAllowed(http_hdr_type hdr_id);
 SQUIDCEXTERN int httpAnonHdrDenied(http_hdr_type hdr_id);
 SQUIDCEXTERN void httpBuildRequestHeader(HttpRequest *, HttpRequest *, StoreEntry *, HttpHeader *, http_state_flags);
-SQUIDCEXTERN void httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor);
 SQUIDCEXTERN const char *httpMakeVaryMark(HttpRequest * request, HttpReply const * reply);
 
 /* ETag */
 SQUIDCEXTERN int etagParseInit(ETag * etag, const char *str);
 SQUIDCEXTERN int etagIsEqual(const ETag * tag1, const ETag * tag2);
 
-/* Http Status Line */
-/* init/clean */
-SQUIDCEXTERN void httpStatusLineInit(HttpStatusLine * sline);
-SQUIDCEXTERN void httpStatusLineClean(HttpStatusLine * sline);
-/* set/get values */
-SQUIDCEXTERN void httpStatusLineSet(HttpStatusLine * sline, http_version_t version,
-                                    http_status status, const char *reason);
-SQUIDCEXTERN const char *httpStatusLineReason(const HttpStatusLine * sline);
-/* parse/pack */
-/* parse a 0-terminating buffer and fill internal structires; returns true on success */
-SQUIDCEXTERN int httpStatusLineParse(HttpStatusLine * sline, const char *start,
-                                     const char *end);
-/* pack fields using Packer */
-SQUIDCEXTERN void httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p);
 SQUIDCEXTERN const char *httpStatusString(http_status status);
 
 /* Http Body */
@@ -459,7 +435,6 @@ SQUIDCEXTERN void httpHeaderStoreReport(StoreEntry * e);
 SQUIDCEXTERN void httpHdrMangleList(HttpHeader *, HttpRequest *);
 
 /* Http Msg (currently in HttpReply.c @?@ ) */
-SQUIDCEXTERN int httpMsgIsPersistent(http_version_t http_ver, const HttpHeader * hdr);
 SQUIDCEXTERN int httpMsgIsolateHeaders(const char **parse_start, const char **blk_start, const char **blk_end);
 
 SQUIDCEXTERN void icmpOpen(void);
index 572d8f493fd879dd0c40f4e3c9eef2526a108c50..9d0864612700baabb2424bf3065e5f61e1a5e6ae 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.573 2003/08/10 11:00:44 robertc Exp $
+ * $Id: store.cc,v 1.574 2003/09/01 03:49:39 robertc Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -649,10 +649,9 @@ storeSetPublicKey(StoreEntry * e)
 
         if (mem->vary_headers && !storeGetPublic(mem->url, mem->method)) {
             /* Create "vary" base object */
-            http_version_t version;
             String vary;
             pe = storeCreateEntry(mem->url, mem->log_url, request->flags, request->method);
-            httpBuildVersion(&version, 1, 0);
+            HttpVersion version(1, 0);
             /* We are allowed to do this typecast */
             httpReplySetHeaders((HttpReply *)pe->getReply(), version, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
             vary = httpHeaderGetList(&mem->getReply()->header, HDR_VARY);
index 31f2f20836f10f2471a873850c4639d53ad67f87..2b65b1fe10a35b079cc6c0f521c5d7839bb65f69 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_digest.cc,v 1.56 2003/02/21 22:50:12 robertc Exp $
+ * $Id: store_digest.cc,v 1.57 2003/09/01 03:49:40 robertc Exp $
  *
  * DEBUG: section 71    Store Digest Manager
  * AUTHOR: Alex Rousskov
@@ -420,7 +420,6 @@ static void
 storeDigestRewriteResume(void)
 {
     StoreEntry *e;
-    http_version_t version;
 
     assert(sd_state.rewrite_lock);
     assert(!sd_state.rebuild_lock);
@@ -431,7 +430,7 @@ storeDigestRewriteResume(void)
     storeSetPublicKey(e);
     /* fake reply */
     HttpReply *rep = httpReplyCreate ();
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1, 0);
     httpReplySetHeaders(rep, version, HTTP_OK, "Cache Digest OK",
                         "application/cache-digest", store_digest->mask_size + sizeof(sd_state.cblock),
                         squid_curtime, squid_curtime + Config.digest.rewrite_period);
index 4b31b626719bff3919a1707599e3f0c8a4ffc015..352ca7221624d8d1cb18806b523e3bbfe21772c0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.480 2003/08/18 12:24:45 hno Exp $
+ * $Id: structs.h,v 1.481 2003/09/01 03:49:40 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -90,11 +90,6 @@ struct _body_size
     size_t maxsize;
 };
 
-struct _http_version_t
-{
-    unsigned int major;
-    unsigned int minor;
-};
 
 #if SQUID_SNMP
 
@@ -832,15 +827,6 @@ struct _Packer
     void *real_handler;                /* first parameter to real append and vprintf */
 };
 
-/* http status line */
-
-struct _HttpStatusLine
-{
-    /* public, read only */
-    http_version_t version;
-    const char *reason;                /* points to a _constant_ string (default or supplied), never free()d */
-    http_status status;
-};
 
 /*
  * Note: HttpBody is used only for messages with a small content that is
@@ -994,68 +980,6 @@ struct _HierarchyLogEntry
     struct timeval store_complete_stop;
 };
 
-struct _AccessLogEntry
-{
-    /* NB: memset is used on AccessLogEntries as at 20030715 RBC */
-    const char *url;
-
-    struct
-    {
-        method_t method;
-        int code;
-        const char *content_type;
-        http_version_t version;
-    }
-
-    http;
-
-    struct
-    {
-        icp_opcode opcode;
-    }
-
-    icp;
-
-    struct
-    {
-
-        struct in_addr caddr;
-        size_t size;
-        off_t highOffset;
-        size_t objectSize;
-        log_type code;
-        int msec;
-        const char *rfc931;
-        const char *authuser;
-#if USE_SSL
-
-        const char *ssluser;
-#endif
-
-        const char *extuser;
-
-    }
-
-    cache;
-
-    struct
-    {
-        char *request;
-        char *reply;
-    }
-
-    headers;
-
-    struct
-    {
-        const char *method_str;
-    }
-
-    _private;
-    HierarchyLogEntry hier;
-    HttpReply *reply;
-    HttpRequest *request;
-};
 
 struct _ipcache_addrs
 {
index c201769d9c4c10bd1a2ac4b786296bf2995aa01b..13395a63057f302b0e859fc5148ea72c31068723 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: typedefs.h,v 1.169 2003/08/10 09:53:49 robertc Exp $
+ * $Id: typedefs.h,v 1.170 2003/09/01 03:49:40 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -113,8 +113,6 @@ class fde;
 
 typedef struct _fileMap fileMap;
 
-typedef struct _HttpStatusLine HttpStatusLine;
-
 typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs;
 
 class HttpHeaderFieldInfo;
@@ -201,8 +199,6 @@ typedef struct _body_size body_size;
 
 class HttpRequest;
 
-typedef struct _AccessLogEntry AccessLogEntry;
-
 typedef struct _cachemgr_passwd cachemgr_passwd;
 
 typedef struct _refresh_t refresh_t;
@@ -273,8 +269,6 @@ typedef struct _RemovalPolicyNode RemovalPolicyNode;
 
 typedef struct _RemovalPolicySettings RemovalPolicySettings;
 
-typedef struct _http_version_t http_version_t;
-
 #if SQUID_SNMP
 typedef variable_list *(oid_ParseFn) (variable_list *, snint *);
 
index d5f57773d79b8fe1767871c09f47f92836f8a5fa..cb400e4ad796dcf3016eb4f3423ee46148e3635d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: urn.cc,v 1.85 2003/08/10 11:00:45 robertc Exp $
+ * $Id: urn.cc,v 1.86 2003/09/01 03:49:40 robertc Exp $
  *
  * DEBUG: section 52    URN Parsing
  * AUTHOR: Kostas Anagnostakis
@@ -315,12 +315,14 @@ urnHandleReply(void *data, StoreIOBuffer result)
     ErrorState *err;
     int i;
     int urlcnt = 0;
-    http_version_t version;
     char *buf = urnState->reqbuf;
     StoreIOBuffer tempBuffer;
 
     debug(52, 3) ("urnHandleReply: Called with size=%u.\n", (unsigned int)result.length);
 
+    /* Can't be lower because of the goto's */
+    HttpVersion version(1, 0);
+
     if (EBIT_TEST(urlres_e->flags, ENTRY_ABORTED)) {
         goto error;
     }
@@ -433,7 +435,6 @@ urnHandleReply(void *data, StoreIOBuffer result)
                  "</ADDRESS>\n",
                  full_appname_string, getMyHostname());
     rep = httpReplyCreate();
-    httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL,
                         "text/html", mb.size, 0, squid_curtime);
 
index 0e4c420372f8d8e9d0a19f81c67a2c06d717979a..8ec8ab23179b57b2614f7f58c61df93dfa7d4126 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: whois.cc,v 1.27 2003/08/10 11:00:45 robertc Exp $
+ * $Id: whois.cc,v 1.28 2003/09/01 03:49:40 robertc Exp $
  *
  * DEBUG: section 75    WHOIS protocol
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -113,8 +113,7 @@ void
 WhoisState::setReplyToOK(StoreEntry *entry)
 {
     HttpReply *reply = httpReplyCreate();
-    http_version_t version;
-    httpBuildVersion(&version, 1, 0);
+    HttpVersion version(1, 0);
     httpReplySetHeaders(reply, version, HTTP_OK, NULL, NULL, 0, 0, -1);
     storeEntryReplaceObject (entry, reply);
 }