diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-08-27 17:21:50 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-08-30 20:53:55 +0200 |
commit | 4c2e86ddd75f0e655fcb21aa8597dc71ce5330be (patch) | |
tree | 19af5664452cfd4a76f5fb2a5f3c2c999a30fe13 /src/Network.hs | |
parent | b2278c50bfce8d8c6f80d04822ecedf42081659d (diff) |
Call refStorage only internally in Storage modules
Diffstat (limited to 'src/Network.hs')
-rw-r--r-- | src/Network.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network.hs b/src/Network.hs index 6685045..3614de0 100644 --- a/src/Network.hs +++ b/src/Network.hs @@ -178,7 +178,7 @@ forkServerThread server act = modifyMVar_ (serverThreads server) $ \ts -> do startServer :: ServerOptions -> Head LocalState -> (String -> IO ()) -> [SomeService] -> IO Server startServer opt serverOrigHead logd' serverServices = do - let serverStorage = refStorage $ headRef serverOrigHead + let serverStorage = headStorage serverOrigHead serverIdentity_ <- newMVar $ headLocalIdentity serverOrigHead serverThreads <- newMVar [] serverSocket <- newEmptyMVar @@ -342,14 +342,14 @@ dataResponseWorker server = forever $ do return (Nothing, []) Left dgst -> do atomically (writeTVar tvar $ Left [dgst]) - return (Just wr, [partialRefFromDigest (refStorage $ wrefPartial wr) dgst]) + return (Just wr, [dgst]) ds' -> do atomically (writeTVar tvar $ Left ds') return (Just wr, []) Right _ -> return (Nothing, []) atomically $ putTMVar (peerWaitingRefs peer) $ catMaybes $ map fst list - let reqs = map refDigest $ concat $ map snd list + let reqs = concat $ map snd list when (not $ null reqs) $ do let packet = TransportPacket (TransportHeader $ map DataRequest reqs) [] ackedBy = concat [[ Rejected r, DataResponse r ] | r <- reqs ] |