Skip to content

Commit

Permalink
fix for catching VerNego
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Nov 22, 2024
1 parent a018fdb commit 5e47a93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Network/QUIC/Closer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ closure conn ldcc (Right x) = do
closure' conn ldcc $ ConnectionClose NoError 0 ""
return x
closure conn ldcc (Left se)
| isAsyncException se = E.throwIO se
| Just e@(TransportErrorIsSent err desc) <- E.fromException se = do
closure' conn ldcc $ ConnectionClose err 0 desc
E.throwIO e
Expand All @@ -36,7 +35,7 @@ closure conn ldcc (Left se)
E.throwIO $ ApplicationProtocolErrorIsSent err desc
| Just (VerNego vers) <- E.fromException se = do
E.throwIO $ NextVersion vers
| otherwise = E.throwIO se
| otherwise = E.throwIO se -- including asynchronous exceptions

closure' :: Connection -> LDCC -> Frame -> IO ()
closure' conn ldcc frame = do
Expand Down

0 comments on commit 5e47a93

Please sign in to comment.