]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed typo in DelayTaggedBucket::stats.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 18 Feb 2009 09:45:32 +0000 (10:45 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 18 Feb 2009 09:45:32 +0000 (10:45 +0100)
Added comments.
String.cci doesn't need to include squid.h, config.h is enough
In errorpage.cc there is no need to drop to char* land, we can work with String.

src/DelayTagged.cc
src/HttpReply.cc
src/ICAP/ICAPXaction.cc
src/String.cci
src/errorpage.cc

index 377c2f6584dbaf947144bad1e31b94228d76bd0b..5947fb94f0a2e57f8b9c5c84f440c909d85380c3 100644 (file)
@@ -195,7 +195,7 @@ DelayTaggedBucket::~DelayTaggedBucket()
 void
 DelayTaggedBucket::stats (StoreEntry *entry) const
 {
-    storeAppendPrintf(entry, " " SQUIDSTRINGPH , SQUIDSTRINGPRINT(tag));
+    storeAppendPrintf(entry, " :" SQUIDSTRINGPH , SQUIDSTRINGPRINT(tag));
     theBucket.stats (entry);
 }
 
index 0ec76cb1bd75d56c2f482fa6e5403e3cb1dd39f5..42d0c21b1899a54f45f37a7a3f2b9971af0027fa 100644 (file)
@@ -439,7 +439,8 @@ HttpReply::bodySize(const HttpRequestMethod& method) const
 
 bool HttpReply::sanityCheckStartLine(MemBuf *buf, http_status *error)
 {
-    if (buf->contentSize() >= protoPrefix.psize() && protoPrefix.cmp(buf->content(), protoPrefix.size()) != 0) { //hack
+    //hack warning: using psize instead of size here due to type mismatches with MemBuf.
+    if (buf->contentSize() >= protoPrefix.psize() && protoPrefix.cmp(buf->content(), protoPrefix.size()) != 0) {
         debugs(58, 3, "HttpReply::sanityCheckStartLine: missing protocol prefix (" << protoPrefix << ") in '" << buf->content() << "'");
         *error = HTTP_INVALID_HEADER;
         return false;
index dcf864c208309fc266e7287294bb8f48b5cbed4c..82993b60bae7ebb91e0b224c8e47e60f554e10f7 100644 (file)
@@ -148,12 +148,14 @@ void ICAPXaction::closeConnection()
         cancelRead(); // may not work
 
         if (reuseConnection && !doneWithIo()) {
+            //status() adds leading spaces.
             debugs(93,5, HERE << "not reusing pconn due to pending I/O" << status());
             reuseConnection = false;
         }
 
         if (reuseConnection) {
             IpAddress client_addr;
+            //status() adds leading spaces.
             debugs(93,3, HERE << "pushing pconn" << status());
             AsyncCall::Pointer call = NULL;
             commSetTimeout(connection, -1, call);
@@ -161,6 +163,7 @@ void ICAPXaction::closeConnection()
                                 theService->cfg().port, NULL, client_addr);
             disableRetries();
         } else {
+            //status() adds leading spaces.
             debugs(93,3, HERE << "closing pconn" << status());
             // comm_close will clear timeout
             comm_close(connection);
index 56958d02866ac5d40c21118970e6370b776a1f04..7f7c881e956d8c1ce0c7bcbf9903056ba02fbd10 100644 (file)
@@ -32,9 +32,9 @@
  *
  */
 
+#include "config.h"
 #include "assert.h"
 #include <cstring>
-#include "squid.h"
 
 #ifdef HAVE_STDINT_H
 #include <stdint.h> //for INT_MAX
index 20e2c48c3961fb93a3086a6cd01ee3800dc8bfc7..026500a3431ad7893d8122f07401b6043c4222aa 100644 (file)
@@ -942,7 +942,6 @@ ErrorState::BuildContent()
      */
     if (!Config.errorDirectory && request && request->header.getList(HDR_ACCEPT_LANGUAGE, &hdr) ) {
 
-        const char *raw_hdr = hdr.termedBuf(); // raw header string for parsing
         size_t pos = 0; // current parsing position in header string
         char *reset = NULL; // where to reset the p pointer for each new tag file
         char *dt = NULL;
@@ -964,12 +963,12 @@ ErrorState::BuildContent()
              *  - IFF a tag contains only two characters we can wildcard ANY translations matching: <it> '-'? .*
              *    with preference given to an exact match.
              */
-            while (pos < hdr.size() && raw_hdr[pos] != ';' && raw_hdr[pos] != ',' && !xisspace(raw_hdr[pos]) && dt < (dir+256) ) {
-                *dt++ = xtolower(raw_hdr[pos++]);
+            while (pos < hdr.size() && hdr[pos] != ';' && hdr[pos] != ',' && !xisspace(hdr[pos]) && dt < (dir+256) ) {
+                *dt++ = xtolower(hdr[pos++]);
             }
             *dt++ = '\0'; // nul-terminated the filename content string before system use.
 
-            debugs(4, 9, HERE << "STATE: dt='" << dt << "', reset='" << reset << "', reset[1]='" << reset[1] << "', pos=" << pos << ", buf='" << &raw_hdr[pos] << "'");
+            debugs(4, 9, HERE << "STATE: dt='" << dt << "', reset='" << reset << "', reset[1]='" << reset[1] << "', pos=" << pos << ", buf='" << hdr.substr(pos,hdr.size()) << "'");
 
             /* if we found anything we might use, try it. */
             if (*reset != '\0') {
@@ -997,8 +996,8 @@ ErrorState::BuildContent()
             dt = reset; // reset for next tag testing. we replace the failed name instead of cloning.
 
             // IFF we terminated the tag on ';' we need to skip the 'q=' bit to the next ',' or end.
-            while (pos < hdr.size() && raw_hdr[pos] != ',') pos++;
-            if (raw_hdr[pos] == ',') pos++;
+            while (pos < hdr.size() && hdr[pos] != ',') pos++;
+            if (hdr[pos] == ',') pos++;
         }
     }
 #endif /* USE_ERR_LOCALES */