Skip to content

Commit

Permalink
locking properly
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Feb 7, 2024
1 parent 43f3418 commit e4ff87d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/Network/TLS/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bye ctx = liftIO $ do
role <- usingState_ ctx getRole
if role == ClientRole
then do
sendCFifNecessary ctx
withWriteLock ctx $ sendCFifNecessary ctx
-- receiving NewSessionTicket
recvNST <- tls13stRecvNST <$> getTLS13State ctx
unless recvNST $ do
Expand Down Expand Up @@ -164,7 +164,7 @@ sendData ctx dataToSend = liftIO $ do
modifyTLS13State ctx $
\st -> st{tls13stPendingSentData = tls13stPendingSentData st . (bs :)}
| otherwise = sendPacket12 ctx $ AppData bs
when tls13 $ sendCFifNecessary ctx
when tls13 $ withWriteLock ctx $ sendCFifNecessary ctx
withWriteLock ctx $ do
checkValid ctx
-- All chunks are protected with the same write lock because we don't
Expand Down

0 comments on commit e4ff87d

Please sign in to comment.