summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-09-14 21:05:07 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-09-16 09:58:30 +0200
commitcbdffb714cf24eacfe08586f56109e46df234806 (patch)
tree98838afbd8b5b242b9c3481af0fbc37cba7feee2 /src
parent07893b2edd6f872f9549b3e0eb5443208cdea66a (diff)
Protocol: check if control flow is free before processing incoming packet
Diffstat (limited to 'src')
-rw-r--r--src/Network/Protocol.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Network/Protocol.hs b/src/Network/Protocol.hs
index e286a67..0f099e0 100644
--- a/src/Network/Protocol.hs
+++ b/src/Network/Protocol.hs
@@ -267,6 +267,7 @@ passUpIncoming GlobalState {..} = do
processIncoming :: GlobalState addr -> STM (IO ())
processIncoming gs@GlobalState {..} = do
guard =<< isEmptyTMVar gNextUp
+ guard =<< canWriteFlow gControlFlow
(addr, msg) <- readFlow gDataFlow
mbconn <- findConnection gs addr