mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-08-28 05:04:40 +00:00
xftp: update http2 to remove workarounds with padding and delay (#667)
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ source-repository-package
|
||||
source-repository-package
|
||||
type: git
|
||||
location: https://github.com/kazu-yamamoto/http2.git
|
||||
tag: aa56ded3494dd4f0efb0bbcb5378879ce785a647
|
||||
tag: c2567c30d471671302b01961d0fe1c21e1477c87
|
||||
|
||||
source-repository-package
|
||||
type: git
|
||||
|
||||
@@ -57,15 +57,12 @@ sendEncFile :: Handle -> (Builder -> IO ()) -> LC.SbState -> Word32 -> IO ()
|
||||
sendEncFile h send = go
|
||||
where
|
||||
go sbState 0 = do
|
||||
-- TODO padding somehow also solves timing issue in HTTP2 (?)
|
||||
let authTag = BA.convert (LC.sbAuth sbState) <> B.replicate (fileBlockSize - C.authTagSize) '#'
|
||||
let authTag = BA.convert (LC.sbAuth sbState)
|
||||
send $ byteString authTag
|
||||
go sbState sz =
|
||||
getFileChunk h sz >>= \ch -> do
|
||||
let (encCh, sbState') = LC.sbEncryptChunk sbState ch
|
||||
send (byteString encCh) `E.catch` \(e :: E.SomeException) -> print e >> E.throwIO e
|
||||
-- TODO remove delay when HTTP2 issue is fixed
|
||||
threadDelay 500
|
||||
go sbState' $ sz - fromIntegral (B.length ch)
|
||||
|
||||
getFileChunk :: Handle -> Word32 -> IO ByteString
|
||||
|
||||
Reference in New Issue
Block a user