xftp: update http2 to remove workarounds with padding and delay (#667)

This commit is contained in:
Evgeny Poberezkin
2023-03-02 16:00:46 +00:00
committed by GitHub
parent e764a51fc0
commit 914240108d
2 changed files with 2 additions and 5 deletions
+1 -1
View File
@@ -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
+1 -4
View File
@@ -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