]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish: allow service of internal requests over reverse-proxy ports
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 30 Dec 2011 12:29:14 +0000 (01:29 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 30 Dec 2011 12:29:14 +0000 (01:29 +1300)
There is no reason why a revers-proxy port cannot service Squid internal
requests as well as whatever domain is being accelerated.

Also, scan the https_port list same as http_port list now that the
structures have been normalized.

src/tools.cc

index 10231afd6dab140fbeb56fa5d6c2fb4b6d353cba..bc0d83162e1e4a4e20a51299e0ba84ff793342b0 100644 (file)
@@ -1258,18 +1258,23 @@ parseEtcHosts(void)
 int
 getMyPort(void)
 {
-    if (Config.Sockaddr.http) {
-        // skip any special mode ports
-        http_port_list *p = Config.Sockaddr.http;
-        while (p && (p->intercepted || p->accel || p->spoof_client_ip))
+    http_port_list *p = NULL;
+    if ((p = Config.Sockaddr.http)) {
+        // skip any special interception ports
+        while (p && (p->intercepted || p->spoof_client_ip))
             p = p->next;
         if (p)
             return p->s.GetPort();
     }
 
 #if USE_SSL
-    if (Config.Sockaddr.https)
-        return Config.Sockaddr.https->s.GetPort();
+    if ((p = Config.Sockaddr.https)) {
+        // skip any special interception ports
+        while (p && (p->intercepted || p->spoof_client_ip))
+            p = p->next;
+        if (p)
+            return p->s.GetPort();
+    }
 #endif
 
     debugs(21, DBG_CRITICAL, "ERROR: No forward-proxy ports configured.");