]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/anyp/PortCfg.cc
Merged from trunk (r13356).
[thirdparty/squid.git] / src / anyp / PortCfg.cc
index ca810cc7ece925243315cd753468de222e2250bd..6392d03d4e3836ee00d6548fd773fa1291d5c3f7 100644 (file)
@@ -28,9 +28,9 @@ AnyP::PortCfg::PortCfg() :
         connection_auth_disabled(false),
         vport(0),
         disable_pmtu_discovery(0),
-        listenConn()
+        listenConn(),
 #if USE_OPENSSL
-        ,cert(NULL),
+        cert(NULL),
         key(NULL),
         version(0),
         cipher(NULL),
@@ -55,8 +55,9 @@ AnyP::PortCfg::PortCfg() :
         dhParams(),
         contextMethod(),
         sslContextFlags(0),
-        sslOptions(0)
+        sslOptions(0),
 #endif
+        ftp_track_dirs(false)
 {
     memset(&tcp_keepalive, 0, sizeof(tcp_keepalive));
 }
@@ -102,6 +103,7 @@ AnyP::PortCfg::clone() const
     b->connection_auth_disabled = connection_auth_disabled;
     b->disable_pmtu_discovery = disable_pmtu_discovery;
     b->tcp_keepalive = tcp_keepalive;
+    b->ftp_track_dirs = ftp_track_dirs;
 
 #if 0
     // TODO: AYJ: 2009-07-18: for now SSL does not clone. Configure separate ports with IPs and SSL settings
@@ -187,12 +189,15 @@ 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 if (strcasecmp("ftp", aProtocol) == 0)
+        transport = AnyP::ProtocolVersion(AnyP::PROTO_FTP, 1,0);
+
     else
         fatalf("http(s)_port protocol=%s is not supported\n", aProtocol);
 }