fix wrong passing of arguments in receive-loop part checking
This commit is contained in:
parent
3bd4cb667d
commit
6c5e40f8ad
|
@ -766,7 +766,7 @@ sendRequestToWithParams timeoutMillis numAttempts msgIncomplete sock = do
|
||||||
-> Map.Map Integer BS.ByteString -- ^ the remaining unacked request parts
|
-> Map.Map Integer BS.ByteString -- ^ the remaining unacked request parts
|
||||||
-> IO ()
|
-> IO ()
|
||||||
sendAndAck responseQueue sock' remainingSends = do
|
sendAndAck responseQueue sock' remainingSends = do
|
||||||
sendMany sock $ Map.elems remainingSends
|
sendMany sock' $ Map.elems remainingSends
|
||||||
-- if all requests have been acked/ responded to, return prematurely
|
-- if all requests have been acked/ responded to, return prematurely
|
||||||
recvLoop sock' responseQueue remainingSends Set.empty Nothing
|
recvLoop sock' responseQueue remainingSends Set.empty Nothing
|
||||||
recvLoop :: Socket
|
recvLoop :: Socket
|
||||||
|
@ -786,10 +786,11 @@ sendRequestToWithParams timeoutMillis numAttempts msgIncomplete sock = do
|
||||||
newTotalParts = if isFinalPart msg then Just (part msg) else totalParts
|
newTotalParts = if isFinalPart msg then Just (part msg) else totalParts
|
||||||
newRemaining = Map.delete (part msg) remainingSends'
|
newRemaining = Map.delete (part msg) remainingSends'
|
||||||
newReceivedParts = Set.insert (part msg) receivedPartNums
|
newReceivedParts = Set.insert (part msg) receivedPartNums
|
||||||
if Map.null newRemaining && maybe False (\p -> Set.size receivedPartNums == fromIntegral p) newTotalParts
|
if Map.null newRemaining && maybe False (\p -> Set.size newReceivedParts == fromIntegral p) newTotalParts
|
||||||
then pure ()
|
then pure ()
|
||||||
else recvLoop sock' responseQueue newRemaining receivedPartNums newTotalParts
|
else recvLoop sock' responseQueue newRemaining newReceivedParts newTotalParts
|
||||||
-- drop errors and invalid messages
|
-- drop errors and invalid messages
|
||||||
|
Right Request{} -> pure () -- expecting a response, not a request
|
||||||
Left _ -> recvLoop sock' responseQueue remainingSends' receivedPartNums totalParts
|
Left _ -> recvLoop sock' responseQueue remainingSends' receivedPartNums totalParts
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue