mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: FTP - download progress, close target file at error
This commit is contained in:
parent
2dfa24a57e
commit
1f7d3e0067
2 changed files with 4 additions and 4 deletions
|
|
@ -648,7 +648,7 @@ begin
|
|||
begin
|
||||
FLastError:= libssh2_session_last_errno(FSession);
|
||||
if (FLastError <> LIBSSH2_ERROR_EAGAIN) then Exit(False);
|
||||
if (FileSize > 0) then DoProgress((FileSize - TotalBytesToRead) * 100 div FileSize);
|
||||
if (FileSize > 0) then DoProgress(TotalBytesToRead * 100 div FileSize);
|
||||
FSock.CanRead(10);
|
||||
end;
|
||||
until not ((SourceHandle = nil) and (FLastError = LIBSSH2_ERROR_EAGAIN));
|
||||
|
|
@ -680,11 +680,11 @@ begin
|
|||
end;
|
||||
Result:= True;
|
||||
finally
|
||||
RetrStream.Free;
|
||||
FreeMem(FBuffer);
|
||||
Result:= CloseChannel(SourceHandle) and Result;
|
||||
end;
|
||||
finally
|
||||
RetrStream.Free;
|
||||
libssh2_session_set_blocking(FSession, 1);
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ begin
|
|||
begin
|
||||
FLastError:= libssh2_session_last_errno(FSession);
|
||||
if (FLastError <> LIBSSH2_ERROR_EAGAIN) then Exit(False);
|
||||
if (FileSize > 0) then DoProgress((FileSize - TotalBytesToRead) * 100 div FileSize);
|
||||
if (FileSize > 0) then DoProgress(TotalBytesToRead * 100 div FileSize);
|
||||
FSock.CanRead(10);
|
||||
end;
|
||||
until not ((SourceHandle = nil) and (FLastError = LIBSSH2_ERROR_EAGAIN));
|
||||
|
|
@ -355,11 +355,11 @@ begin
|
|||
end;
|
||||
Result:= True;
|
||||
finally
|
||||
RetrStream.Free;
|
||||
FreeMem(FBuffer);
|
||||
Result:= FileClose(SourceHandle) and Result;
|
||||
end;
|
||||
finally
|
||||
RetrStream.Free;
|
||||
libssh2_session_set_blocking(FSession, 1);
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue