Bug 1497868 - In nsFtp, close data pipe as well. r=mayhemer
authorDragana Damjanovic <dd.mozilla@gmail.com>
Tue, 27 Nov 2018 19:48:20 +0000
changeset 507602 1de661bbcc0ca1a2a32b589ef9cdc29ca374bfc1
parent 507601 49aba2e71c128cd0d1be6df09e7931884ed91b3e
child 507603 ed3560460fe93c21664313f318c25cf2cb5eefc6
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1497868
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497868 - In nsFtp, close data pipe as well. r=mayhemer Differential Revision: https://phabricator.services.mozilla.com/D12740
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -1469,17 +1469,20 @@ nsFtpState::R_pasv() {
                         newDataConn = false;
                 }
             }
         }
 
         if (newDataConn) {
             mDataTransport->Close(NS_ERROR_ABORT);
             mDataTransport = nullptr;
-            mDataStream = nullptr;
+            if (mDataStream) {
+                mDataStream->CloseWithStatus(NS_ERROR_ABORT);
+                mDataStream = nullptr;
+            }
         }
     }
 
     if (newDataConn) {
         // now we know where to connect our data channel
         nsCOMPtr<nsISocketTransportService> sts =
             do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
         if (!sts)
@@ -2121,17 +2124,20 @@ nsFtpState::CloseWithStatus(nsresult sta
     }
 
     if (mDataTransport) {
         // Shutdown the data transport.
         mDataTransport->Close(NS_ERROR_ABORT);
         mDataTransport = nullptr;
     }
 
-    mDataStream = nullptr;
+    if (mDataStream) {
+        mDataStream->CloseWithStatus(NS_ERROR_ABORT);
+        mDataStream = nullptr;
+    }
 
     return nsBaseContentStream::CloseWithStatus(status);
 }
 
 static nsresult
 CreateHTTPProxiedChannel(nsIChannel *channel, nsIProxyInfo *pi, nsIChannel **newChannel)
 {
     nsresult rv;