mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-03 00:21:52 +00:00
comment
This commit is contained in:
@@ -747,6 +747,7 @@ receiveViaCompleteFD user fileId RcvFileDescr {fileDescrText, fileDescrComplete}
|
||||
rd <- parseFileDescription fileDescrText
|
||||
let FD.ValidFileDescription FD.FileDescription {size = FD.FileSize encSize, redirect} = rd
|
||||
redirectSize = maybe 0 (\FD.RedirectFileInfo {size = FD.FileSize s} -> toInteger s) redirect
|
||||
-- for a redirect, encSize is the description blob and redirectSize the final file; take the larger
|
||||
rcvSize = max (toInteger encSize) redirectSize
|
||||
-- 10 MB margin: encryption and chunk-size rounding make the transfer larger than the advertised size
|
||||
maxRcvSize = min expectedFileSize (toInteger FD.maxFileSizeHard) + toInteger (FD.mb 10 :: Int64)
|
||||
|
||||
Reference in New Issue
Block a user