]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved ftpAccept outside the irrelevant #if USE_OPENSSL clause.
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 30 Jul 2014 18:21:54 +0000 (12:21 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 30 Jul 2014 18:21:54 +0000 (12:21 -0600)
src/client_side.cc

index 5ceebc57d9b4835310dfb33e0b05b41af0bf81e2..51fae836360eb9365da1cb1de0d91414d060ab0b 100644 (file)
@@ -3634,6 +3634,46 @@ httpAccept(const CommAcceptCbParams &params)
 #endif
 }
 
+/** handle a new FTP connection */
+static void
+ftpAccept(const CommAcceptCbParams &params)
+{
+    MasterXaction::Pointer xact = params.xaction;
+    AnyP::PortCfgPointer s = xact->squidPort;
+
+    // NP: it is possible the port was reconfigured when the call or accept() was queued.
+
+    if (params.flag != Comm::OK) {
+        // Its possible the call was still queued when the client disconnected
+        debugs(33, 2, "ftpAccept: " << s->listenConn << ": accept failure: " << xstrerr(params.xerrno));
+        return;
+    }
+
+    debugs(33, 4, HERE << params.conn << ": accepted");
+    fd_note(params.conn->fd, "client ftp connect");
+
+    if (s->tcp_keepalive.enabled) {
+        commSetTcpKeepalive(params.conn->fd, s->tcp_keepalive.idle, s->tcp_keepalive.interval, s->tcp_keepalive.timeout);
+    }
+
+    ++incoming_sockets_accepted;
+
+    // Socket is ready, setup the connection manager to start using it
+    ConnStateData *connState = new ConnStateData(xact);
+
+    if (connState->transparent()) {
+        char buf[MAX_IPSTRLEN];
+        connState->clientConnection->local.toUrl(buf, MAX_IPSTRLEN);
+        connState->ftp.host = buf;
+        const char *uri = connState->ftpBuildUri();
+        debugs(33, 5, HERE << "FTP transparent URL: " << uri);
+    }
+
+    FtpWriteEarlyReply(connState, 220, "Service ready");
+
+    // TODO: Merge common httpAccept() parts, applying USE_DELAY_POOLS to FTP.
+}
+
 #if USE_OPENSSL
 
 /** Create SSL connection structure and update fd_table */
@@ -3924,46 +3964,6 @@ httpsAccept(const CommAcceptCbParams &params)
     }
 }
 
-/** handle a new FTP connection */
-static void
-ftpAccept(const CommAcceptCbParams &params)
-{
-    MasterXaction::Pointer xact = params.xaction;
-    AnyP::PortCfgPointer s = xact->squidPort;
-
-    // NP: it is possible the port was reconfigured when the call or accept() was queued.
-
-    if (params.flag != Comm::OK) {
-        // Its possible the call was still queued when the client disconnected
-        debugs(33, 2, "ftpAccept: " << s->listenConn << ": accept failure: " << xstrerr(params.xerrno));
-        return;
-    }
-
-    debugs(33, 4, HERE << params.conn << ": accepted");
-    fd_note(params.conn->fd, "client ftp connect");
-
-    if (s->tcp_keepalive.enabled) {
-        commSetTcpKeepalive(params.conn->fd, s->tcp_keepalive.idle, s->tcp_keepalive.interval, s->tcp_keepalive.timeout);
-    }
-
-    ++incoming_sockets_accepted;
-
-    // Socket is ready, setup the connection manager to start using it
-    ConnStateData *connState = new ConnStateData(xact);
-
-    if (connState->transparent()) {
-        char buf[MAX_IPSTRLEN];
-        connState->clientConnection->local.toUrl(buf, MAX_IPSTRLEN);
-        connState->ftp.host = buf;
-        const char *uri = connState->ftpBuildUri();
-        debugs(33, 5, HERE << "FTP transparent URL: " << uri);
-    }
-
-    FtpWriteEarlyReply(connState, 220, "Service ready");
-
-    // TODO: Merge common httpAccept() parts, applying USE_DELAY_POOLS to FTP.
-}
-
 void
 ConnStateData::sslCrtdHandleReplyWrapper(void *data, const HelperReply &reply)
 {