]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Merge cleanup code from comms branch.
authorrobertc <>
Thu, 6 Mar 2003 13:21:36 +0000 (13:21 +0000)
committerrobertc <>
Thu, 6 Mar 2003 13:21:36 +0000 (13:21 +0000)
Keywords:

Patches applied:

  * robertc@squid-cache.org--squid/squid--comms--3.0--patch-8
     Tidyup.

  * robertc@squid-cache.org--squid/squid--comms--3.0--patch-7
     Sync with HEAD.

  * robertc@squid-cache.org--squid/squid--comms--3.0--patch-6
     Merge from HEAD.

  * robertc@squid-cache.org--squid/squid--comms--3.0--patch-5
     Merge from HEAD.

16 files changed:
src/HttpHdrRange.cc
src/HttpHeader.cc
src/HttpHeaderTools.cc
src/HttpReply.cc
src/HttpRequest.cc
src/SquidString.h
src/String.cc
src/String.cci
src/SwapDir.h
src/asn.cc
src/external_acl.cc
src/fs/ufs/store_dir_ufs.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/urn.cc

index 4b336d13ad45a971ab25183eb01f1a036609a0bc..560b8c8c2fe76a590144c558c0caae5b622533a8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHdrRange.cc,v 1.31 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpHdrRange.cc,v 1.32 2003/03/06 06:21:36 robertc Exp $
  *
  * DEBUG: section 64    HTTP Range Header
  * AUTHOR: Alex Rousskov
@@ -304,7 +304,7 @@ HttpHdrRange::parseInit(const String * range_spec)
     debug(64, 8) ("parsing range field: '%s'\n", range_spec->buf());
     /* check range type */
 
-    if (range_spec->nCaseCmp("bytes=", 6))
+    if (range_spec->caseCmp("bytes=", 6))
         return 0;
 
     /* skip "bytes="; hack! */
index 0476ec4adc839528e217960d5ba1cd0a9be6e281..e0ea9586a150df7874f6893bed85995f63541b4d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.cc,v 1.85 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpHeader.cc,v 1.86 2003/03/06 06:21:36 robertc Exp $
  *
  * DEBUG: section 55    HTTP Header
  * AUTHOR: Alex Rousskov
@@ -578,7 +578,7 @@ httpHeaderDelByName(HttpHeader * hdr, const char *name)
     debug(55, 7) ("deleting '%s' fields in hdr %p\n", name, hdr);
 
     while ((e = httpHeaderGetEntry(hdr, &pos))) {
-        if (!strCaseCmp(e->name, name)) {
+        if (!e->name.caseCmp(name)) {
             httpHeaderDelAt(hdr, pos);
             count++;
         } else
@@ -660,7 +660,6 @@ httpHeaderAddEntry(HttpHeader * hdr, HttpHeaderEntry * e)
 String
 httpHeaderGetList(const HttpHeader * hdr, http_hdr_type id)
 {
-    String s = StringNull;
     HttpHeaderEntry *e;
     HttpHeaderPos pos = HttpHeaderInitPos;
     debug(55, 6) ("%p: joining for id %d\n", hdr, id);
@@ -668,7 +667,9 @@ httpHeaderGetList(const HttpHeader * hdr, http_hdr_type id)
     assert(CBIT_TEST(ListHeadersMask, id));
 
     if (!CBIT_TEST(hdr->mask, id))
-        return s;
+        return String();
+
+    String s;
 
     while ((e = httpHeaderGetEntry(hdr, &pos))) {
         if (e->id == id)
@@ -702,7 +703,7 @@ httpHeaderGetStrOrList(const HttpHeader * hdr, http_hdr_type id)
     if ((e = httpHeaderFindEntry(hdr, id)))
         return e->value;
 
-    return String::Null;
+    return String();
 }
 
 /*
@@ -714,7 +715,6 @@ httpHeaderGetByName(const HttpHeader * hdr, const char *name)
     http_hdr_type id;
     HttpHeaderPos pos = HttpHeaderInitPos;
     HttpHeaderEntry *e;
-    String result = StringNull;
 
     assert(hdr);
     assert(name);
@@ -725,9 +725,11 @@ httpHeaderGetByName(const HttpHeader * hdr, const char *name)
     if (id != -1)
         return httpHeaderGetStrOrList(hdr, id);
 
+    String result;
+
     /* Sorry, an unknown header name. Do linear search */
     while ((e = httpHeaderGetEntry(hdr, &pos))) {
-        if (e->id == HDR_OTHER && strCaseCmp(e->name, name) == 0) {
+        if (e->id == HDR_OTHER && e->name.caseCmp(name) == 0) {
             strListAdd(&result, e->value.buf(), ',');
         }
     }
@@ -741,7 +743,6 @@ httpHeaderGetByName(const HttpHeader * hdr, const char *name)
 String
 httpHeaderGetByNameListMember(const HttpHeader * hdr, const char *name, const char *member, const char separator)
 {
-    String result = StringNull;
     String header;
     const char *pos = NULL;
     const char *item;
@@ -753,6 +754,8 @@ httpHeaderGetByNameListMember(const HttpHeader * hdr, const char *name, const ch
 
     header = httpHeaderGetByName(hdr, name);
 
+    String result;
+
     while (strListGetItem(&header, separator, &item, &ilen, &pos)) {
         if (strncmp(item, member, mlen) == 0 && item[mlen] == '=') {
             result.append(item + mlen + 1, ilen - mlen - 1);
@@ -769,7 +772,6 @@ httpHeaderGetByNameListMember(const HttpHeader * hdr, const char *name, const ch
 String
 httpHeaderGetListMember(const HttpHeader * hdr, http_hdr_type id, const char *member, const char separator)
 {
-    String result = StringNull;
     String header;
     const char *pos = NULL;
     const char *item;
@@ -780,6 +782,7 @@ httpHeaderGetListMember(const HttpHeader * hdr, http_hdr_type id, const char *me
     assert(id >= 0);
 
     header = httpHeaderGetStrOrList(hdr, id);
+    String result;
 
     while (strListGetItem(&header, separator, &item, &ilen, &pos)) {
         if (strncmp(item, member, mlen) == 0 && item[mlen] == '=') {
index 2bcca3ecaba4b88d6a013709cd56bafc7d93df21..5a2897a865d2a1928a80d400b0bb4d2a0b32c79d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeaderTools.cc,v 1.38 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpHeaderTools.cc,v 1.39 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 66    HTTP Header Tools
  * AUTHOR: Alex Rousskov
@@ -209,7 +209,7 @@ int
 strListIsSubstr(const String * list, const char *s, char del)
 {
     assert(list && del);
-    return strStr(*list, s) != 0;
+    return list->pos(s) != 0;
 
     /*
      * Note: the original code with a loop is broken because it uses strstr()
index 94fa4694b3ff0ca6e9014c795ea1734779a4a5bb..497d9435d5fdfe9cacf7a313927396f2bed65bae 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.cc,v 1.54 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpReply.cc,v 1.55 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 58    HTTP Reply (Response)
  * AUTHOR: Alex Rousskov
@@ -286,7 +286,7 @@ httpReplySetHeaders(HttpReply * reply, http_version_t ver, http_status status, c
         httpHeaderPutStr(hdr, HDR_CONTENT_TYPE, ctype);
         reply->content_type = ctype;
     } else
-        reply->content_type = StringNull;
+        reply->content_type = String();
 
     if (clen >= 0)
         httpHeaderPutInt(hdr, HDR_CONTENT_LENGTH, clen);
@@ -457,7 +457,7 @@ httpReplyHdrCacheInit(HttpReply * rep)
     if (str)
         rep->content_type.limitInit(str, strcspn(str, ";\t "));
     else
-        rep->content_type = StringNull;
+        rep->content_type = String();
 
     rep->cache_control = httpHeaderGetCc(hdr);
 
index d690744d3458843605ade09919fd328197184899..f989a6b8cd651e1a63da674bd61fd1a4669c6c0f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.cc,v 1.35 2003/02/21 22:50:05 robertc Exp $
+ * $Id: HttpRequest.cc,v 1.36 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 73    HTTP Request
  * AUTHOR: Duane Wessels
@@ -211,7 +211,7 @@ httpRequestHdrCacheInit(request_t * req)
     if (str)
         stringLimitInit(&req->content_type, str, strcspn(str, ";\t "));
     else
-        req->content_type = StringNull;
+        req->content_type = String();
 
 #endif
 
index 2f7340da3d03cf8a0f7a2d0cd567f795b492beeb..a0bf3eab223bbf8010111016bec378461a817cf9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: SquidString.h,v 1.2 2003/02/21 22:50:06 robertc Exp $
+ * $Id: SquidString.h,v 1.3 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 67    String
  * AUTHOR: Duane Wessels
@@ -40,7 +40,6 @@ class String
 {
 
 public:
-    static const String Null;
     _SQUID_INLINE_ String();
     String (char const *);
     String (String const &);
@@ -51,6 +50,7 @@ public:
 
     _SQUID_INLINE_ int size() const;
     _SQUID_INLINE_ char const * buf() const;
+    void buf(char *);
     void init (char const *);
     void initBuf(size_t sz);
     void limitInit(const char *str, int len);
@@ -60,29 +60,30 @@ public:
     void append(char const *buf);
     void append (String const &);
     void absorb(String &old);
-    _SQUID_INLINE_ int nCaseCmp (char const *aString, int aLen) const;
+    _SQUID_INLINE_ const char * pos(char const *) const;
+    _SQUID_INLINE_ const char * pos(char const ch) const;
+    _SQUID_INLINE_ const char * rpos(char const ch) const;
+    _SQUID_INLINE_ int cmp (char const *) const;
+    _SQUID_INLINE_ int cmp (char const *, size_t count) const;
+    _SQUID_INLINE_ int caseCmp (char const *) const;
+    _SQUID_INLINE_ int caseCmp (char const *, size_t count) const;
+
+    _SQUID_INLINE_ void set
+        (char const *loc, char const ch);
+
+    _SQUID_INLINE_ void cut (size_t newLength);
+
+    _SQUID_INLINE_ void cutPointer (char const *loc);
 
 private:
     /* never reference these directly! */
     unsigned short int size_;  /* buffer size; 64K limit */
 
-public:
     unsigned short int len_;   /* current length  */
+
     char *buf_;
 };
 
-#define StringNull String::Null;
-/* String */
-#define strChr(s,ch)  ((const char*)strchr((s).buf(), (ch)))
-#define strRChr(s,ch) ((const char*)strrchr((s).buf(), (ch)))
-#define strStr(s,str) ((const char*)strstr((s).buf(), (str)))
-#define strCmp(s,str)     strcmp((s).buf(), (str))
-#define strNCmp(s,str,n)     strncmp((s).buf(), (str), (n))
-#define strCaseCmp(s,str) strcasecmp((s).buf(), (str))
-#define strSet(s,ptr,ch) (s).buf_[ptr-(s).buf_] = (ch)
-#define strCut(s,pos) (((s).len_ = pos) , ((s).buf_[pos] = '\0'))
-#define strCutPtr(s,ptr) (((s).len_ = (ptr)-(s).buf_) , ((s).buf_[(s).len_] = '\0'))
-
 #ifdef _USE_INLINE_
 #include "String.cci"
 #endif
index 124edd7b363f0bc10e2de5ccf6b56810c45c9a24..a962c703e2d019b001bd5780fdf48b2e31784cb3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: String.cc,v 1.13 2003/02/21 22:50:06 robertc Exp $
+ * $Id: String.cc,v 1.14 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 67    String
  * AUTHOR: Duane Wessels
@@ -35,8 +35,6 @@
 
 #include "squid.h"
 
-String const String::Null;
-
 void
 String::initBuf(size_t sz)
 {
@@ -173,6 +171,13 @@ String::absorb(String &old)
     old.len_ = 0;
 }
 
+void
+String::buf(char *newBuf)
+{
+    assert (buf_ == NULL);
+    buf_ = newBuf;
+}
+
 #ifndef _USE_INLINE_
 #include "String.cci"
 #endif
index 239ad0990bb376e952a66d7f1217621af7474aeb..878451858210bb424c26f38c62052c04d41ba96d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: String.cci,v 1.1 2003/01/23 00:37:15 robertc Exp $
+ * $Id: String.cci,v 1.2 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 67    String
  * AUTHOR: Duane Wessels
@@ -34,8 +34,7 @@
  */
 
 String::String() : size_(0), len_(0), buf_ (NULL)
-{
-}
+{}
 
 int
 String::size() const
@@ -49,8 +48,67 @@ String::buf() const
     return buf_;
 }
 
+const char *
+String::pos(char const *aString) const
+{
+    return strstr(buf(), aString);
+}
+
+const char *
+String::pos(char const ch) const
+{
+    return strchr(buf(), ch);
+}
+
+const char *
+String::rpos(char const ch) const
+{
+    return strrchr(buf(), (ch));
+}
+
+int
+String::cmp (char const *aString) const
+{
+    return strcmp(buf(), aString);
+}
+
+int
+String::cmp (char const *aString, size_t count) const
+{
+    return strncmp(buf(), aString, count);
+}
+
 int
-String::nCaseCmp (char const *aString, int aLen) const
+String::caseCmp (char const *aString) const
 {
-    return strncasecmp(buf(), aString, aLen);
+    return strcasecmp(buf(), aString);
 }
+
+int
+String::caseCmp (char const *aString, size_t count) const
+{
+    return strncasecmp(buf(), aString, count);
+}
+
+void
+
+String::set
+    (char const *loc, char const ch)
+{
+    buf_[loc-buf_] = ch;
+}
+
+void
+String::cut (size_t newLength)
+{
+    len_ = newLength;
+    buf_[newLength] = '\0';
+}
+
+void
+String::cutPointer (char const *loc)
+{
+    len_ = loc-buf_;
+    buf_[len_] = '\0';
+}
+
index 2abd4e667b62acf578ccbabae7b85d06cd8bb03d..7c78da611050325b83e133243a52f4979a1f41ba 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: SwapDir.h,v 1.3 2003/02/21 22:50:06 robertc Exp $
+ * $Id: SwapDir.h,v 1.4 2003/03/06 06:21:37 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -47,7 +47,7 @@ struct SwapDir
 
 public:
     static SwapDir *Factory (_storefs_entry const &fs);
-    SwapDir() : max_objsize (-1)
+    SwapDir() : cur_size (0), low_size(0), max_size(0), max_objsize (-1)
     {
         fs.blksize = 1024;
     }
@@ -65,8 +65,9 @@ public:
     int removals;
     int scanned;
 
-    struct
+    struct Flags
     {
+        Flags() : selected(0), read_only(0){}
 
 unsigned int selected:
         1;
index 85dc45655ce85857cae3dd3cf1c3f79d9cc81a33..c46e95de64d1308f9472ddc6a693726f9a92d963 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.cc,v 1.91 2003/02/25 12:24:34 robertc Exp $
+ * $Id: asn.cc,v 1.92 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -496,10 +496,10 @@ destroyRadixNodeInfo(as_info * e_info)
     while (data) {
         prev = data;
         data = data->next;
-        xfree(prev);
+        prev->deleteSelf();
     }
 
-    xfree(data);
+    data->deleteSelf();
 }
 
 static int
index 70f0a7b54f921ea1f33d69e73ac1f2cdee7c8fcc..00d21096f922e1e315d39c6d78d700f29699a412 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: external_acl.cc,v 1.33 2003/03/04 01:40:27 robertc Exp $
+ * $Id: external_acl.cc,v 1.34 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 82    External ACL
  * AUTHOR: Henrik Nordstrom, MARA Systems AB
@@ -598,11 +598,11 @@ makeExternalAclKey(ACLChecklist * ch, external_acl_data * acl_data)
     wordlist *arg;
     external_acl_format *format;
     request_t *request = ch->request;
-    String sb = StringNull;
     memBufReset(&mb);
 
     for (format = acl_data->def->format; format; format = format->next) {
         const char *str = NULL;
+        String sb;
 
         switch (format->type) {
 
index e720ab4da03d9079626f42af31b8245f3af495ae..480c4684c5bdabdd72d9896adf12b81063496607 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.56 2003/02/21 22:50:45 robertc Exp $
+ * $Id: store_dir_ufs.cc,v 1.57 2003/03/06 06:21:41 robertc Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -334,28 +334,32 @@ UFSSwapDir::statfs(StoreEntry & sentry) const
 void
 UFSSwapDir::maintainfs()
 {
+    /* We can't delete objects while rebuilding swap */
+
+    if (store_dirs_rebuilding)
+        return;
+
     StoreEntry *e = NULL;
+
     int removed = 0;
-    int max_scan;
-    int max_remove;
-    double f;
+
     RemovalPurgeWalker *walker;
-    /* We can't delete objects while rebuilding swap */
 
-    if (store_dirs_rebuilding) {
-        return;
-    } else {
-        f = (double) (cur_size - low_size) / (max_size - low_size);
-        f = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f;
-        max_scan = (int) (f * 400.0 + 100.0);
-        max_remove = (int) (f * 70.0 + 10.0);
-        /*
-         * This is kinda cheap, but so we need this priority hack?
-         */
-    }
+    double f = (double) (cur_size - low_size) / (max_size - low_size);
+
+    f = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f;
+
+    int max_scan = (int) (f * 400.0 + 100.0);
+
+    int max_remove = (int) (f * 70.0 + 10.0);
+
+    /*
+     * This is kinda cheap, but so we need this priority hack?
+     */
 
     debug(47, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n",
                   f, max_scan, max_remove);
+
     walker = repl->PurgeInit(repl, max_scan);
 
     while (1) {
index fdd11ae83d07f8286b74bfa2e9b9b062f58a24ab..8137ebe06582be17b5c19b5f81f5d376d8ee5932 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.346 2003/03/04 01:40:27 robertc Exp $
+ * $Id: ftp.cc,v 1.347 2003/03/06 06:21:37 robertc Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1243,10 +1243,10 @@ ftpCheckUrlpath(FtpStateData * ftpState)
     int l;
     const char *t;
 
-    if ((t = strRChr(request->urlpath, ';')) != NULL) {
+    if ((t = request->urlpath.rpos(';')) != NULL) {
         if (strncasecmp(t + 1, "type=", 5) == 0) {
             ftpState->typecode = (char) toupper((int) *(t + 6));
-            strCutPtr(request->urlpath, t);
+            request->urlpath.cutPointer(t);
         }
     }
 
@@ -1257,7 +1257,7 @@ ftpCheckUrlpath(FtpStateData * ftpState)
     if (!l) {
         ftpState->flags.isdir = 1;
         ftpState->flags.root_dir = 1;
-    } else if (!strCmp(request->urlpath, "/%2f/")) {
+    } else if (!request->urlpath.cmp("/%2f/")) {
         /* UNIX root directory */
         ftpState->flags.need_base_href = 0;
         ftpState->flags.isdir = 1;
@@ -1771,7 +1771,7 @@ ftpSendType(FtpStateData * ftpState)
         if (ftpState->flags.isdir) {
             mode = 'A';
         } else {
-            t = strRChr(ftpState->request->urlpath, '/');
+            t = ftpState->request->urlpath.rpos('/');
             filename = t ? t + 1 : ftpState->request->urlpath.buf();
             mode = mimeGetTransferMode(filename);
         }
@@ -2830,7 +2830,7 @@ ftpFail(FtpStateData * ftpState)
     if (!ftpState->flags.isdir &&      /* Not a directory */
             !ftpState->flags.try_slash_hack && /* Not in slash hack */
             ftpState->mdtm <= 0 && ftpState->size < 0 &&       /* Not known as a file */
-            ftpState->request->urlpath.nCaseCmp("/%2f", 4) != 0) {     /* No slash encoded */
+            ftpState->request->urlpath.caseCmp("/%2f", 4) != 0) {      /* No slash encoded */
 
         switch (ftpState->state) {
 
@@ -3033,7 +3033,7 @@ ftpAppendSuccessHeader(FtpStateData * ftpState)
 
     EBIT_CLR(e->flags, ENTRY_FWD_HDR_WAIT);
 
-    filename = (t = strRChr(urlpath, '/')) ? t + 1 : urlpath.buf();
+    filename = (t = urlpath.rpos('/')) ? t + 1 : urlpath.buf();
 
     if (ftpState->flags.isdir) {
         mime_type = "text/html";
index 4b6395a3e2b6285bf81d6c3fff38d01002a8fd69..e2a8859f9528867381d04cce52c4f5e9372e2f0c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.181 2003/03/04 01:40:28 robertc Exp $
+ * $Id: gopher.cc,v 1.182 2003/03/06 06:21:38 robertc Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -328,7 +328,6 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
     char *tline = NULL;
     LOCAL_ARRAY(char, line, TEMP_BUF_SIZE);
     LOCAL_ARRAY(char, tmpbuf, TEMP_BUF_SIZE);
-    String outbuf = StringNull;
     char *name = NULL;
     char *selector = NULL;
     char *host = NULL;
@@ -374,6 +373,7 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
     }
 
     inbuf[len] = '\0';
+    String outbuf;
 
     if (!gopherState->HTML_header_added) {
         if (gopherState->conversion == gopher_ds::HTML_CSO_RESULT)
index b15bbc2e3b26cb35e0e34f4a71ae76738a5cdd7e..82eb66f080fb1c6dc2d853e3ec58fd8ba12454c3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.411 2003/03/04 01:40:28 robertc Exp $
+ * $Id: http.cc,v 1.412 2003/03/06 06:21:38 robertc Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -1051,7 +1051,6 @@ httpBuildRequestHeader(request_t * request,
     /* building buffer for complex strings */
 #define BBUF_SZ (MAX_URL+32)
     LOCAL_ARRAY(char, bbuf, BBUF_SZ);
-    String strConnection = StringNull;
     const HttpHeader *hdr_in = &orig_request->header;
     const HttpHeaderEntry *e;
     String strFwd;
@@ -1064,7 +1063,7 @@ httpBuildRequestHeader(request_t * request,
 
     bool we_do_ranges = decideIfWeDoRanges (orig_request);
 
-    strConnection = httpHeaderGetList(hdr_in, HDR_CONNECTION);
+    String strConnection (httpHeaderGetList(hdr_in, HDR_CONNECTION));
 
     while ((e = httpHeaderGetEntry(hdr_in, &pos)))
         copyOneHeaderFromClientsideRequestToUpstreamRequest(e, strConnection, request, orig_request, hdr_out, we_do_ranges, flags);
index 3dba79d2f5e464cc077c60ec6e8b5074080f699b..f70723cfacb119a355d9a36eb1f556dbefdebb36 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: urn.cc,v 1.82 2003/02/21 22:50:13 robertc Exp $
+ * $Id: urn.cc,v 1.83 2003/03/06 06:21:38 robertc Exp $
  *
  * DEBUG: section 52    URN Parsing
  * AUTHOR: Kostas Anagnostakis
@@ -174,10 +174,10 @@ UrnState::getHost (String &urlpath)
     char * result;
     char const *t;
 
-    if ((t = strChr(urlpath, ':')) != NULL) {
-        strSet(urlpath, t, '\0');
+    if ((t = urlpath.pos(':')) != NULL) {
+        urlpath.set(t, '\0');
         result = xstrdup(urlpath.buf());
-        strSet(urlpath, t, ':');
+        urlpath.set(t, ':');
     } else {
         result = xstrdup(urlpath.buf());
     }