From 08392f16cca5a6f27263e972be51b8cf51f86855 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 11 May 2000 13:03:59 +0000 Subject: [PATCH] bug in ~wxOutputFTPStream which prevented multiple uploads fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/ftp.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index f4a1b3843a..1d5e801965 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -400,11 +400,23 @@ public: : wxSocketOutputStream(*sock), m_ftp(ftp_clt) {} virtual ~wxOutputFTPStream(void) { - if (LastError() != wxStream_NOERROR) - m_ftp->GetResult('2'); - else - m_ftp->Abort(); - delete m_o_socket; + if ( IsOk() ) + { + // close data connection first, this will generate "transfer + // completed" reply + delete m_o_socket; + + // read this reply + m_ftp->GetResult('2'); + } + else + { + // abort data connection first + m_ftp->Abort(); + + // and close it after + delete m_o_socket; + } } };