]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed PortCfg.transport setting broken in r12961
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 16 Apr 2014 21:58:08 +0000 (15:58 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 16 Apr 2014 21:58:08 +0000 (15:58 -0600)
"Update the http(s)_port directives protocol= parameter"

The port protocol became PROTO_HTTP regardless of the protocol name passed
by the caller. The other allowed value (PROTO_HTTPS) could not be set.

src/anyp/PortCfg.cc

index ca810cc7ece925243315cd753468de222e2250bd..693ce6a36ac0e63b8b116676cc049135060a8c2b 100644 (file)
@@ -187,10 +187,10 @@ AnyP::PortCfg::setTransport(const char *aProtocol)
     // HTTP/1.0 not supported because we are version 1.1 which contains a superset of 1.0
     // and RFC 2616 requires us to upgrade 1.0 to 1.1
 
-    if (strcasecmp("http", aProtocol) != 0 || strcmp("HTTP/1.1", aProtocol) != 0)
+    if (strcasecmp("http", aProtocol) == 0 || strcmp("HTTP/1.1", aProtocol) == 0)
         transport = AnyP::ProtocolVersion(AnyP::PROTO_HTTP, 1,1);
 
-    else if (strcasecmp("https", aProtocol) != 0 || strcmp("HTTPS/1.1", aProtocol) != 0)
+    else if (strcasecmp("https", aProtocol) == 0 || strcmp("HTTPS/1.1", aProtocol) == 0)
         transport = AnyP::ProtocolVersion(AnyP::PROTO_HTTPS, 1,1);
 
     else