xftp: constrain supported file size to 1gb

This commit is contained in:
Evgeny Poberezkin
2023-03-01 13:50:08 +00:00
parent 6227215c3f
commit faec32dc5e
2 changed files with 17 additions and 3 deletions
+7 -2
View File
@@ -158,8 +158,13 @@ testPrepareChunkSizes = do
r3 = replicate 3
uploadProgress :: String -> Bool
uploadProgress s = "Uploading file..." `isPrefixOf` s && "File uploaded!" `isInfixOf` s
uploadProgress s =
"Encrypting file..." `isPrefixOf` s
&& "Uploading file..." `isInfixOf` s
&& "File uploaded!" `isInfixOf` s
downloadProgress :: FilePath -> String -> Bool
downloadProgress fileName s =
"Downloading file..." `isPrefixOf` s && ("File downloaded: " <> recipientFiles </> fileName <> "\r") `isSuffixOf` s
"Downloading file..." `isPrefixOf` s
&& "Decrypting file..." `isInfixOf` s
&& ("File downloaded: " <> recipientFiles </> fileName <> "\r") `isSuffixOf` s