]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Verified and converted more String users.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 31 Jan 2009 17:23:17 +0000 (18:23 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 31 Jan 2009 17:23:17 +0000 (18:23 +0100)
src/HttpHdrExtField.cc
src/HttpHdrRange.cc
src/HttpHdrSc.cc

index c4a5678a5252f212f4c315acc973de9c22b1f4a4..d3e70acb85475a0e891272e9455dcb95dee60643 100644 (file)
@@ -96,6 +96,6 @@ httpHdrExtFieldDup(HttpHdrExtField * f)
 {
     assert(f);
     return httpHdrExtFieldDoCreate(
-               f->name.unsafeBuf(), f->name.size(),
-               f->value.unsafeBuf(), f->value.size());
+               f->name.rawBuf(), f->name.size(),
+               f->value.rawBuf(), f->value.size());
 }
index 6045a996a6d0db8bfe84866345fc2e29040c0917..858ff6d7953a7a71632cc9c6eddea2d066d41447 100644 (file)
@@ -251,14 +251,14 @@ HttpHdrRange::parseInit(const String * range_spec)
     int count = 0;
     assert(this && range_spec);
     ++ParsedCount;
-    debugs(64, 8, "parsing range field: '" << range_spec->unsafeBuf() << "'");
+    debugs(64, 8, "parsing range field: '" << range_spec << "'");
     /* check range type */
 
     if (range_spec->caseCmp("bytes=", 6))
         return 0;
 
     /* skip "bytes="; hack! */
-    pos = range_spec->unsafeBuf() + 6;
+    pos = range_spec->termedBuf() + 6;
 
     /* iterate through comma separated list */
     while (strListGetItem(range_spec, ',', &item, &ilen, &pos)) {
index 537387f0c092c24f298b144ca8a3aa5f1e18cd26..0be8eafd7fd5285dd1cfe11778d67707554df237 100644 (file)
@@ -138,7 +138,7 @@ httpHdrScParseInit(HttpHdrSc * sc, const String * str)
                                   ScFieldsInfo, SC_ENUM_END);
 
         if (type < 0) {
-            debugs(90, 2, "hdr sc: unknown control-directive: near '" << item << "' in '" << str->unsafeBuf() << "'");
+            debugs(90, 2, "hdr sc: unknown control-directive: near '" << item << "' in '" << str << "'");
             type = SC_OTHER;
         }
 
@@ -162,7 +162,7 @@ httpHdrScParseInit(HttpHdrSc * sc, const String * str)
 
         if (EBIT_TEST(sct->mask, type)) {
             if (type != SC_OTHER)
-                debugs(90, 2, "hdr sc: ignoring duplicate control-directive: near '" << item << "' in '" << str->unsafeBuf() << "'");
+                debugs(90, 2, "hdr sc: ignoring duplicate control-directive: near '" << item << "' in '" << str << "'");
 
             ScFieldsInfo[type].stat.repCount++;
 
@@ -257,7 +257,9 @@ httpHdrScTargetPackInto(const HttpHdrScTarget * sc, Packer * p)
         if (EBIT_TEST(sc->mask, flag) && flag != SC_OTHER) {
 
             /* print option name */
-            packerPrintf(p, (pcount ? ", %s" : "%s"), ScFieldsInfo[flag].name.unsafeBuf());
+            packerPrintf(p, (pcount ? ", %.*s" : "%.*s"),
+                ScFieldsInfo[flag].name.size(),
+                ScFieldsInfo[flag].name.rawBuf());
 
             /* handle options with values */
 
@@ -265,14 +267,14 @@ httpHdrScTargetPackInto(const HttpHdrScTarget * sc, Packer * p)
                 packerPrintf(p, "=%d", (int) sc->max_age);
 
             if (flag == SC_CONTENT)
-                packerPrintf(p, "=\"%s\"", sc->content.unsafeBuf());
+                packerPrintf(p, "=\"%.*s\"", sc->content.size(), sc->content.rawBuf());
 
             pcount++;
         }
     }
 
     if (sc->target.size())
-        packerPrintf (p, ";%s", sc->target.unsafeBuf());
+        packerPrintf (p, ";%.*s", sc->target.size(), sc->target.rawBuf());
 }
 
 void
@@ -339,7 +341,7 @@ httpHdrScTargetStatDumper(StoreEntry * sentry, int idx, double val, double size,
     extern const HttpHeaderStat *dump_stat;     /* argh! */
     const int id = (int) val;
     const int valid_id = id >= 0 && id < SC_ENUM_END;
-    const char *name = valid_id ? ScFieldsInfo[id].name.unsafeBuf() : "INVALID";
+    const char *name = valid_id ? ScFieldsInfo[id].name.termedBuf() : "INVALID";
 
     if (count || valid_id)
         storeAppendPrintf(sentry, "%2d\t %-20s\t %5d\t %6.2f\n",
@@ -352,7 +354,7 @@ httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int c
     extern const HttpHeaderStat *dump_stat;    /* argh! */
     const int id = (int) val;
     const int valid_id = id >= 0 && id < SC_ENUM_END;
-    const char *name = valid_id ? ScFieldsInfo[id].name.unsafeBuf() : "INVALID";
+    const char *name = valid_id ? ScFieldsInfo[id].name.termedBuf() : "INVALID";
 
     if (count || valid_id)
         storeAppendPrintf(sentry, "%2d\t %-20s\t %5d\t %6.2f\n",
@@ -369,9 +371,9 @@ httpHdrScFindTarget (HttpHdrSc *sc, const char *target)
     while (node) {
         HttpHdrScTarget *sct = (HttpHdrScTarget *)node->data;
 
-        if (target && sct->target.unsafeBuf() && !strcmp (target, sct->target.unsafeBuf()))
+        if (target && sct->target.defined() && !strcmp (target, sct->target.termedBuf()))
             return sct;
-        else if (!target && !sct->target.unsafeBuf())
+        else if (!target && sct->target.undefined())
             return sct;
 
         node = node->next;