瀏覽代碼

Informing the user when a connection fails because an FTP connection was attempted to an SFTP server

Source commit: c30e9d72d440419c8ee1d08e2486023b8374bf87
Martin Prikryl 10 年之前
父節點
當前提交
d5dfb6f114
共有 3 個文件被更改,包括 7 次插入0 次删除
  1. 5 0
      source/core/FtpFileSystem.cpp
  2. 1 0
      source/resource/TextsCore.h
  3. 1 0
      source/resource/TextsCore1.rc

+ 5 - 0
source/core/FtpFileSystem.cpp

@@ -3482,6 +3482,11 @@ void __fastcall TFTPFileSystem::HandleReplyStatus(UnicodeString Response)
     FOnCaptureOutput(Response, cotOutput);
   }
 
+  if (FWelcomeMessage.IsEmpty() && StartsStr(L"SSH", Response))
+  {
+    FLastErrorResponse->Add(LoadStr(SFTP_AS_FTP_ERROR));
+  }
+
   // Two forms of multiline responses were observed
   // (the first is according to the RFC 959):
 

+ 1 - 0
source/resource/TextsCore.h

@@ -259,6 +259,7 @@
 #define FILEZILLA_SITE_MANAGER_NOT_FOUND 734
 #define FILEZILLA_NO_SITES      735
 #define FILEZILLA_SITE_NOT_EXIST 736
+#define SFTP_AS_FTP_ERROR       737
 
 #define CORE_CONFIRMATION_STRINGS 300
 #define CONFIRM_PROLONG_TIMEOUT3 301

+ 1 - 0
source/resource/TextsCore1.rc

@@ -229,6 +229,7 @@ BEGIN
   FILEZILLA_SITE_MANAGER_NOT_FOUND, "FileZilla site manager file not found (%s)."
   FILEZILLA_NO_SITES, "No sites found in FileZilla site manager file (%s)."
   FILEZILLA_SITE_NOT_EXIST, "FileZilla site \"%s\" was not found."
+  SFTP_AS_FTP_ERROR, "You cannot connect to an SFTP server using an FTP protocol. Please selec the correct protocol."
 
   CORE_CONFIRMATION_STRINGS, "CORE_CONFIRMATION"
   CONFIRM_PROLONG_TIMEOUT3, "Host is not communicating for %d seconds.\n\nWait for another %0:d seconds?"