]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove additional minor performance regression
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Jun 2014 14:02:57 +0000 (07:02 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Jun 2014 14:02:57 +0000 (07:02 -0700)
src/client_side.cc

index 71dfdded01df4c3a1bc08f3148ab9a16d47d80dc..0be2c5c424c7aa4fd5ca341a75d8d6f7f8360905 100644 (file)
@@ -2074,7 +2074,7 @@ prepareAcceleratedURL(ConnStateData * conn, ClientHttpRequest *http, Http1::Requ
         return; /* already in good shape */
 
     // XXX: re-use proper URL parser for this
-    SBuf url = hp.requestUri(); // save point if we abort.
+    SBuf url = hp.requestUri(); // use full provided URI if we abort
     do { // use a loop so we can break out of it
         ::Parser::Tokenizer tok(url);
         if (tok.remaining()[0] == '/')
@@ -2098,14 +2098,14 @@ prepareAcceleratedURL(ConnStateData * conn, ClientHttpRequest *http, Http1::Requ
         if (!tok.skip(authority))
             break;
 
+        static const SBuf slashUri("/");
         SBuf t = tok.remaining();
         if (t.isEmpty())
-            url = SBuf("/");
+            url = slashUri;
         else if (t[0]=='/') // looks like path
             url = t;
         else if (t[0]=='?' || t[0]=='#') { // looks like query or fragment. fix '/'
-            url.clear();
-            url.append("/",1);
+            url = slashUri;
             url.append(t);
         } // else do nothing. invalid path