From 5341784d39ef759c3d634243b8f53468597c0e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Sun, 2 Jun 2024 14:22:39 +0200 Subject: [PATCH] FluentFTP -> 39.4.0 --- src/Peachpie.Library/Ftp.cs | 12 ++++++------ src/Peachpie.Library/Peachpie.Library.csproj | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Peachpie.Library/Ftp.cs b/src/Peachpie.Library/Ftp.cs index 610f752cbd..e746bfb86b 100644 --- a/src/Peachpie.Library/Ftp.cs +++ b/src/Peachpie.Library/Ftp.cs @@ -816,7 +816,7 @@ public static bool ftp_fget(PhpResource ftp_stream, PhpResource handle, string r { // Use the async version to prevent calling Write on the output stream, as it might be not allowed // (e.g. in Kestrel) - return resource.Client.DownloadAsync(stream.RawStream, remotefile, resumepos).Result; + return resource.Client.DownloadStream(stream.RawStream, remotefile, resumepos); } catch (FtpException ex) { @@ -864,7 +864,7 @@ public static bool ftp_fput(PhpResource ftp_stream, string remote_file, PhpResou try { - return resource.Client.Upload(stream.RawStream, remote_file, FtpRemoteExists.Overwrite) != FtpStatus.Failed; + return resource.Client.UploadStream(stream.RawStream, remote_file, FtpRemoteExists.Overwrite) != FtpStatus.Failed; } catch (FtpException ex) { @@ -923,7 +923,7 @@ public static bool ftp_append(Context context, PhpResource ftp_stream, string re /// Loads file on server. /// /// Returns TRUE on success or FALSE on failure. - private static bool Put(Context context, PhpResource ftp_stream, string remote_file, string local_file, int mode, bool append, int startpos) + private static bool Put(Context context, PhpResource ftp_stream, string remote_file, string local_file, int mode, bool addToEnd, int startpos) { var resource = ValidateFtpResource(ftp_stream); if (resource == null) @@ -944,7 +944,7 @@ private static bool Put(Context context, PhpResource ftp_stream, string remote_f try { - return resource.Client.UploadFile(localPath, remote_file, append ? FtpRemoteExists.Append : FtpRemoteExists.Overwrite) != FtpStatus.Failed; + return resource.Client.UploadFile(localPath, remote_file, addToEnd ? FtpRemoteExists.AddToEnd : FtpRemoteExists.Overwrite) != FtpStatus.Failed; } /* FtpException everytime wraps other exceptions (Message from server). * https://github.com/robinrodricks/FluentFTP/blob/master/FluentFTP/Client/FtpClient_HighLevelUpload.cs#L595 */ @@ -1224,7 +1224,7 @@ public static int ftp_nb_fput(PhpResource ftp_stream, string remote_file, PhpRes resource.PrepareForPendingOperation(mode); - resource.PendingOperationTask = resource.Client.UploadAsync(stream.RawStream, remote_file, FtpRemoteExists.Overwrite, false, null, resource.TokenSource.Token); + resource.PendingOperationTask = resource.Client.UploadStreamAsync(stream.RawStream, remote_file, FtpRemoteExists.Overwrite, false, null, resource.TokenSource.Token); return TasksGetInfo(resource); } @@ -1289,7 +1289,7 @@ public static int ftp_nb_fget(PhpResource ftp_stream, PhpResource handle, string resource.PrepareForPendingOperation(mode); - resource.PendingOperationTask = resource.Client.DownloadAsync(stream.RawStream, remote_file, resumepos, null, resource.TokenSource.Token); + resource.PendingOperationTask = resource.Client.DownloadStreamAsync(stream.RawStream, remote_file, resumepos, null, resource.TokenSource.Token); return TasksGetInfo(resource); } diff --git a/src/Peachpie.Library/Peachpie.Library.csproj b/src/Peachpie.Library/Peachpie.Library.csproj index c8157dc4fb..084792d8f9 100644 --- a/src/Peachpie.Library/Peachpie.Library.csproj +++ b/src/Peachpie.Library/Peachpie.Library.csproj @@ -23,7 +23,7 @@ - +