03b9a7
diff --git a/src/clients/FtpGateway.cc b/src/clients/FtpGateway.cc
03b9a7
index 2f09b12..7e13a29 100644
03b9a7
--- a/src/clients/FtpGateway.cc
03b9a7
+++ b/src/clients/FtpGateway.cc
03b9a7
@@ -136,7 +136,10 @@ public:
03b9a7
 
03b9a7
     /// create a data channel acceptor and start listening.
03b9a7
     void listenForDataChannel(const Comm::ConnectionPointer &conn;;
03b9a7
-
03b9a7
+    virtual bool openListenSocket() {
03b9a7
+        ftpOpenListenSocket(this, 0);
03b9a7
+        return Comm::IsConnOpen(data.conn);
03b9a7
+		}
03b9a7
     int checkAuth(const HttpHeader * req_hdr);
03b9a7
     void checkUrlpath();
03b9a7
     void buildTitleUrl();
03b9a7
diff --git a/src/clients/FtpGateway.cc b/src/clients/FtpGateway.cc
03b9a7
index 1a7b092..025df84 100644
03b9a7
--- a/src/clients/FtpGateway.cc
03b9a7
+++ b/src/clients/FtpGateway.cc
03b9a7
@@ -87,6 +87,13 @@ struct GatewayFlags {
03b9a7
 class Gateway;
03b9a7
 typedef void (StateMethod)(Ftp::Gateway *);
03b9a7
 
03b9a7
+} // namespace FTP
03b9a7
+
03b9a7
+static void ftpOpenListenSocket(Ftp::Gateway * ftpState, int fallback);
03b9a7
+
03b9a7
+namespace Ftp
03b9a7
+{
03b9a7
+
03b9a7
 /// FTP Gateway: An FTP client that takes an HTTP request with an ftp:// URI,
03b9a7
 /// converts it into one or more FTP commands, and then
03b9a7
 /// converts one or more FTP responses into the final HTTP response.
03b9a7
diff --git a/src/clients/FtpClient.cc b/src/clients/FtpClient.cc
03b9a7
index a262eea..0978831 100644
03b9a7
--- a/src/clients/FtpClient.cc
03b9a7
+++ b/src/clients/FtpClient.cc
03b9a7
@@ -743,7 +743,8 @@ Ftp::Client::connectDataChannel()
03b9a7
 bool
03b9a7
 Ftp::Client::openListenSocket()
03b9a7
 {
03b9a7
-    return false;
03b9a7
+    debugs(9, 3, HERE);
03b9a7
+	  return false;
03b9a7
 }
03b9a7
 
03b9a7
 /// creates a data channel Comm close callback
03b9a7
diff --git a/src/clients/FtpGateway.cc b/src/clients/FtpGateway.cc
03b9a7
index 025df84..dbc4809 100644
03b9a7
--- a/src/clients/FtpGateway.cc
03b9a7
+++ b/src/clients/FtpGateway.cc
03b9a7
@@ -144,7 +144,8 @@ public:
03b9a7
     /// create a data channel acceptor and start listening.
03b9a7
     void listenForDataChannel(const Comm::ConnectionPointer &conn;;
03b9a7
     virtual bool openListenSocket() {
03b9a7
-        ftpOpenListenSocket(this, 0);
03b9a7
+    		debugs(9, 3, HERE);
03b9a7
+				ftpOpenListenSocket(this, 0);
03b9a7
         return Comm::IsConnOpen(data.conn);
03b9a7
 		}
03b9a7
     int checkAuth(const HttpHeader * req_hdr);
03b9a7
diff --git a/src/clients/FtpClient.h b/src/clients/FtpClient.h
03b9a7
index ef2aa98..10a511e 100644
03b9a7
--- a/src/clients/FtpClient.h
03b9a7
+++ b/src/clients/FtpClient.h
03b9a7
@@ -115,7 +115,7 @@ public:
03b9a7
     bool sendPort();
03b9a7
     bool sendPassive();
03b9a7
     void connectDataChannel();
03b9a7
-    bool openListenSocket();
03b9a7
+    virtual bool openListenSocket();
03b9a7
     void switchTimeoutToDataChannel();
03b9a7
 
03b9a7
     CtrlChannel ctrl; ///< FTP control channel state
03b9a7
diff --git a/src/clients/FtpGateway.cc b/src/clients/FtpGateway.cc
03b9a7
index 8754e62..0ef1171 100644
03b9a7
--- a/src/clients/FtpGateway.cc
03b9a7
+++ b/src/clients/FtpGateway.cc
03b9a7
@@ -1979,7 +1979,7 @@ ftpReadEPRT(Ftp::Gateway * ftpState)
03b9a7
         ftpSendPORT(ftpState);
03b9a7
         return;
03b9a7
     }
03b9a7
-
03b9a7
+    ftpState->ctrl.message = NULL;
03b9a7
     ftpRestOrList(ftpState);
03b9a7
 }
03b9a7