]> git.saurik.com Git - wxWidgets.git/commitdiff
wxFTP::Close() shouldn't hide base wxSocket function
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Mar 2000 18:46:55 +0000 (18:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Mar 2000 18:46:55 +0000 (18:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/protocol/ftp.h
src/common/ftp.cpp

index 459f2bfd6cd353278e745f17f2e1a48921bbcd0b..0e7e59531552006af509d11840e7e91ec5327a62 100644 (file)
@@ -32,8 +32,8 @@ public:
   bool Connect(wxSockAddress& addr, bool wait = TRUE);
   bool Connect(const wxString& host);
 
-  // [forcibly] close the connection
-  bool Close(bool force = FALSE);
+  // close the connection
+  virtual bool Close();
 
   void SetUser(const wxString& user) { m_user = user; }
   void SetPassword(const wxString& passwd) { m_passwd = passwd; }
index 80c0e1a057c0513b1f4c0224dcc89b63ac1c4e2a..e9db032f8e2f761fa9f0217f76bc3e0cdd6361ba 100644 (file)
@@ -71,6 +71,11 @@ wxFTP::wxFTP()
 
 wxFTP::~wxFTP()
 {
+    if ( m_streaming )
+    {
+        (void)Abort();
+    }
+
     Close();
 }
 
@@ -122,17 +127,12 @@ bool wxFTP::Connect(const wxString& host)
   return Connect(addr);
 }
 
-bool wxFTP::Close(bool force)
+bool wxFTP::Close()
 {
     if ( m_streaming )
     {
-        if ( !force )
-        {
-            m_lastError = wxPROTO_STREAMING;
-            return FALSE;
-        }
-
-        (void)Abort();
+        m_lastError = wxPROTO_STREAMING;
+        return FALSE;
     }
 
     if ( IsConnected() )