]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: de-duplicate internal URL detection
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jan 2012 05:58:20 +0000 (22:58 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jan 2012 05:58:20 +0000 (22:58 -0700)
src/client_side.cc

index 47c15f24158376799e02125d3fa71b300982695d..aecd11c0ad4cf8639b230f7945467c794f0b3b46 100644 (file)
@@ -2023,15 +2023,6 @@ prepareAcceleratedURL(ConnStateData * conn, ClientHttpRequest *http, char *url,
             url = (char *) "/";
     }
 
-    if (internalCheck(url)) {
-        /* prepend our name & port */
-        http->uri = xstrdup(internalLocalUri(NULL, url));
-        // We just re-wrote the URL. Must replace the Host: header.
-        //  But have not parsed there yet!! flag for local-only handling.
-        http->flags.internal = 1;
-        return;
-    }
-
     if (vport < 0)
         vport = http->getConn()->clientConnection->local.GetPort();
 
@@ -2280,15 +2271,17 @@ parseHttpRequest(ConnStateData *csd, HttpParser *hp, HttpRequestMethod * method_
         /* intercept or transparent mode, properly working with no failures */
         prepareTransparentURL(csd, http, url, req_hdr);
 
-    } else if (csd->port->accel || csd->switchedToHttps()) {
-        /* accelerator mode */
-        prepareAcceleratedURL(csd, http, url, req_hdr);
-
     } else if (internalCheck(url)) {
         /* internal URL mode */
         /* prepend our name & port */
         http->uri = xstrdup(internalLocalUri(NULL, url));
-        http->flags.accel = 1;
+        // We just re-wrote the URL. Must replace the Host: header.
+        //  But have not parsed there yet!! flag for local-only handling.
+        http->flags.internal = 1;
+
+    } else if (csd->port->accel || csd->switchedToHttps()) {
+        /* accelerator mode */
+        prepareAcceleratedURL(csd, http, url, req_hdr);
     }
 
     if (!http->uri) {