浏览代码

ADD: FTP - print error code when cannot perform the SSH handshake

Alexander Koblov 4 年之前
父节点
当前提交
d54328be4f
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      plugins/wfx/ftp/src/sftp/scpsend.pas

+ 4 - 3
plugins/wfx/ftp/src/sftp/scpsend.pas

@@ -3,7 +3,7 @@
    -------------------------------------------------------------------------
    -------------------------------------------------------------------------
    Wfx plugin for working with File Transfer Protocol
    Wfx plugin for working with File Transfer Protocol
 
 
-   Copyright (C) 2013-2019 Alexander Koblov ([email protected])
+   Copyright (C) 2013-2021 Alexander Koblov ([email protected])
 
 
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
@@ -317,9 +317,10 @@ begin
       //* Since we have not set non-blocking, tell libssh2 we are blocking */
       //* Since we have not set non-blocking, tell libssh2 we are blocking */
       libssh2_session_set_blocking(FSession, 1);
       libssh2_session_set_blocking(FSession, 1);
 
 
-      if libssh2_session_handshake(FSession, FSock.Socket) <> 0 then
+      FLastError:= libssh2_session_handshake(FSession, FSock.Socket);
+      if FLastError <> 0 then
       begin
       begin
-        DoStatus(False, 'Cannot establishing SSH session');
+        DoStatus(False, 'Cannot perform the SSH handshake ' + IntToStr(FLastError));
         Exit(False);
         Exit(False);
       end;
       end;
       LogProc(PluginNumber, MSGTYPE_CONNECT, nil);
       LogProc(PluginNumber, MSGTYPE_CONNECT, nil);