We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f975b45 commit 3d9e8b6Copy full SHA for 3d9e8b6
libs/contrib/Network/Socket.idr
@@ -178,10 +178,10 @@ recvAll sock = recvRec sock [] 64
178
recvRec : Socket -> List String -> ByteLength -> IO (Either SocketError String)
179
recvRec sock acc n = do res <- recv sock n
180
case res of
181
- Left 0 => pure (Right $ concat $ reverse acc)
182
Left c => pure (Left c)
183
- Right (str, _) => let n' = min (n * 2) 65536 in
184
- recvRec sock (str :: acc) n'
+ Right (str, res) => let n' = min (n * 2) 65536 in
+ if res < n then pure (Right $ concat $ reverse $ str :: acc)
+ else recvRec sock (str :: acc) n'
185
186
||| Send a message.
187
|||
0 commit comments