http2 1.5.2 → 1.5.3
raw patch · 2 files changed
+10/−4 lines, 2 files
Files
- http2.cabal +1/−1
- test/HPACK/EncodeSpec.hs +9/−3
http2.cabal view
@@ -1,5 +1,5 @@ Name: http2-Version: 1.5.2+Version: 1.5.3 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3
test/HPACK/EncodeSpec.hs view
@@ -5,7 +5,7 @@ #if __GLASGOW_HASKELL__ < 709 import Control.Applicative ((<$>)) #endif-import Control.Exception (onException)+import qualified Control.Exception as E import qualified Data.ByteString as BS import Network.HPACK import Test.Hspec@@ -36,13 +36,19 @@ go :: DynamicTable -> DynamicTable -> EncodeStrategy -> [HeaderList] -> [Int] -> IO Bool go _ _ _ [] _ = return True go etbl dtbl stgy (h:hs) lens = do- bs <- encodeHeader stgy 4096 etbl h `onException` print h+ bs <- encodeHeader stgy 4096 etbl h `E.catch` \(E.SomeException e) -> do+ putStrLn $ "decodeHeader: " ++ show e+ print h+ E.throwIO e let lens' = case lens of l:ls | BS.length bs == l -> ls | otherwise -> error $ show h ++ "\nshould be " ++ show l [] -> []- h' <- decodeHeader dtbl bs `onException` print h+ h' <- decodeHeader dtbl bs `E.catch` \(E.SomeException e) -> do+ putStrLn $ "encodeHeader: " ++ show e+ print h+ E.throwIO e if h == h' then go etbl dtbl stgy hs lens' else do