xftp: raise internal upload limit to 5gb (#1020)

* xftp: raise internal upload limit to 5gb

* extract hard limit from agent
This commit is contained in:
Alexander Bondarenko authored and GitHub committed 2024-03-02 18:46:05 +00:00
1 parent ce78646c7f
commit 246a0d10c2
2 files changed
+7 -1

No files matched your search

+6
View File
@@ -19,6 +19,7 @@ module Simplex.FileTransfer.Client.Main
prepareChunkSizes,
prepareChunkSpecs,
maxFileSize,
maxFileSizeHard,
fileSizeLen,
getChunkDigest,
SentRecipientReplica (..),
@@ -76,12 +77,17 @@ import UnliftIO.Directory
xftpClientVersion :: String
xftpClientVersion = "1.0.1"
-- | Soft limit for XFTP clients. Should be checked and reported to user.
maxFileSize :: Int64
maxFileSize = gb 1
maxFileSizeStr :: String
maxFileSizeStr = B.unpack . strEncode $ FileSize maxFileSize
-- | Hard internal limit for XFTP agent after which it refuses to prepare chunks.
maxFileSizeHard :: Int64
maxFileSizeHard = gb 5
fileSizeLen :: Int64
fileSizeLen = 8