diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2020-12-29 21:48:29 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-12-30 21:47:58 +0100 |
commit | 796c31765a576b8b24acebd32f0797c1a64f3667 (patch) | |
tree | 937972268ed03b841446d11eb11dab9154d5983e | |
parent | cc132e005f974577c2ff782add7df8247c4eb541 (diff) |
Network: do not send empty service response
-rw-r--r-- | src/Network.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Network.hs b/src/Network.hs index 7bb9fea..d1343f4 100644 --- a/src/Network.hs +++ b/src/Network.hs @@ -375,8 +375,9 @@ startServer opt origHead logd' services = do putTMVar svcStates global Just h -> do (rsp, (s', gs')) <- handleServicePacket h inp s gs (wrappedLoad ref :: Stored s) - identity <- readMVar midentity - sendToPeerList identity peer rsp + when (not (null rsp)) $ do + identity <- readMVar midentity + sendToPeerList identity peer rsp atomically $ do putTMVar (peerServiceState peer) $ M.insert svc (SomeServiceState proxy s') svcs putTMVar svcStates $ M.insert svc (SomeServiceGlobalState proxy gs') global |