mirror of
https://github.com/postgres-haskell/postgres-wire.git
synced 2024-11-22 05:53:12 +03:00
Fixed rawReceive
This commit is contained in:
parent
2072ede0a6
commit
defecb8103
@ -92,7 +92,7 @@ rawReceive s bs n = B.unsafeUseAsCStringLen bs $ \(prevPtr, prevLen) ->
|
||||
in B.createUptoN bufSize $ \bufPtr -> do
|
||||
B.memcpy bufPtr (castPtr prevPtr) prevLen
|
||||
len <- unsafeReceive s (bufPtr `plusPtr` prevLen)
|
||||
(fromIntegral bufSize) mempty
|
||||
(fromIntegral n) mempty
|
||||
-- Received empty string means closed connection by the remote host
|
||||
when (len == 0) throwClosedException
|
||||
pure $ prevLen + fromIntegral len
|
||||
|
Loading…
Reference in New Issue
Block a user