summaryrefslogtreecommitdiff
path: root/Assistant/NetMessager.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-10 01:34:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-10 01:34:03 -0400
commitcf18a864ff07942475ed1c24743d0985e3bec642 (patch)
treefd75862dd87eb7514a645a02dd4828db8baec5f6 /Assistant/NetMessager.hs
parent9878bea94e465333bbfb32ae7bb410d59014749c (diff)
fix deferring of CanPush, and stop deferring StartingPush
Diffstat (limited to 'Assistant/NetMessager.hs')
-rw-r--r--Assistant/NetMessager.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Assistant/NetMessager.hs b/Assistant/NetMessager.hs
index 8fac55c8a..ab1c6aabe 100644
--- a/Assistant/NetMessager.hs
+++ b/Assistant/NetMessager.hs
@@ -61,8 +61,8 @@ runPush v handledeferred a = do
<~> handledeferred m
{- While a push is running, matching push messages are put into
- - netMessagesPush, while others go to netMessagesDeferredPush. To avoid
- - bloating memory, only PushRequest and StartingPush messages are
+ - netMessagesPush, while others go to netMessagesDeferredPush.
+ - To avoid bloating memory, only messages that initiate pushes are
- deferred.
-
- When no push is running, returns False.
@@ -82,10 +82,8 @@ queueNetPushMessage m = do
writeTChan (netMessagesPush nm) m
return True
| otherwise = do
- case m of
- PushRequest _ -> defer nm
- StartingPush _ -> defer nm
- _ -> noop
+ when (isPushInitiationMessage m) $
+ defer nm
return True
defer nm = do
s <- takeTMVar (netMessagesDeferredPush nm)