]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: de-duplicate internal URL detection
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 30 Dec 2011 12:26:51 +0000 (01:26 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 30 Dec 2011 12:26:51 +0000 (01:26 +1300)
src/client_side.cc

index 6e146ac77e73ca749c83cf907db96661f4f82fd1..9beb0a737bbc40083c1c2904945f78ad1f6f4208 100644 (file)
@@ -2024,15 +2024,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();
 
@@ -2281,15 +2272,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) {