Skip to content

Commit

Permalink
added use "libssh2_session_handshake"
Browse files Browse the repository at this point in the history
  • Loading branch information
pult committed Sep 19, 2020
1 parent 6457241 commit 97e1278
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions comp/uMySFTPClient.pas
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{ uMySFTPClient.pas } // version: 2020.0919.0015
{ **
* Copyright (c) 2010, Zeljko Marjanovic <[email protected]>
* This code is licensed under MPL 1.1
Expand Down Expand Up @@ -1381,9 +1382,22 @@ TAbstractData = record
if (R <> 0) and ADebugMode then log('Error setting comp_sc: ' + sError);
end;

if ADebugMode then log('libssh2_session_startup:'); // @dbg
R := libssh2_session_startup(FSession, FSocket);
if ADebugMode then log('libssh2_session_startup.'); // @dbg
R := 0;
OK := False;
if Assigned(Addr(libssh2_session_handshake)) then
try
if ADebugMode then log('libssh2_session_handshake:'); // @dbg
R := libssh2_session_handshake(FSession, FSocket);
if ADebugMode then log('libssh2_session_handshake.'); // @dbg
OK := True;
except
end;
if not OK then // use old version libssh2:
begin
if ADebugMode then log('libssh2_session_startup:'); // @dbg
R := libssh2_session_startup(FSession, FSocket);
if ADebugMode then log('libssh2_session_startup.'); // @dbg
end;
if R = 0 then
begin
if Assigned(FHashMgr) then
Expand Down Expand Up @@ -1491,7 +1505,9 @@ TAbstractData = record
Inc(iRepeat);

AuthOK := False;
{$warnings off}
if ADebugMode then log('ParseAuthList: "' + string(StrPas(UserAuthList)) + '"'); // @dbg
{$warnings on}
AuthMode := ParseAuthList(UserAuthList);
if ADebugMode then log('ParseAuthList.'); // @dbg
if amTryAll in AuthMode then
Expand Down

0 comments on commit 97e1278

Please sign in to comment.