فهرست منبع

Factoring out Disconnect method

Source commit: 9593dce1270cad2df50111d775569bf4c0445afb
Martin Prikryl 6 سال پیش
والد
کامیت
a9d399be81
2فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 8 4
      source/core/FtpFileSystem.cpp
  2. 1 0
      source/core/FtpFileSystem.h

+ 8 - 4
source/core/FtpFileSystem.cpp

@@ -543,8 +543,7 @@ void __fastcall TFTPFileSystem::Close()
   if (DebugAlwaysTrue(Result))
   {
     DebugAssert(FActive);
-    Discard();
-    FTerminal->Closed();
+    Disconnect();
   }
 }
 //---------------------------------------------------------------------------
@@ -2957,6 +2956,12 @@ void __fastcall TFTPFileSystem::GotNonCommandReply(unsigned int Reply)
   DebugFail();
 }
 //---------------------------------------------------------------------------
+void __fastcall TFTPFileSystem::Disconnect()
+{
+  Discard();
+  FTerminal->Closed();
+}
+//---------------------------------------------------------------------------
 UnicodeString __fastcall TFTPFileSystem::GotReply(unsigned int Reply, unsigned int Flags,
   UnicodeString Error, unsigned int * Code, TStrings ** Response)
 {
@@ -3017,8 +3022,7 @@ UnicodeString __fastcall TFTPFileSystem::GotReply(unsigned int Reply, unsigned i
           if (FLAGCLEAR(Flags, REPLY_CONNECT))
           {
             MoreMessages->Add(LoadStr(LOST_CONNECTION));
-            Discard();
-            FTerminal->Closed();
+            Disconnect();
           }
           else
           {

+ 1 - 0
source/core/FtpFileSystem.h

@@ -209,6 +209,7 @@ protected:
   void __fastcall RegisterChecksumAlgCommand(const UnicodeString & Alg, const UnicodeString & Command);
   void __fastcall SendCommand(const UnicodeString & Command);
   bool __fastcall CanTransferSkipList(int Params, unsigned int Flags, const TCopyParamType * CopyParam);
+  void __fastcall Disconnect();
 
   static bool __fastcall Unquote(UnicodeString & Str);