need to use return value of recvmsg for length of received data
This commit is contained in:
parent
2f49216e15
commit
fd1ec1aeaa
|
@ -138,7 +138,9 @@ proc asyncRecvMsg*(fd: AsyncFD,
|
||||||
retFuture.fail(newException(ValueError, "unexpected ancillary data"))
|
retFuture.fail(newException(ValueError, "unexpected ancillary data"))
|
||||||
return
|
return
|
||||||
|
|
||||||
dataBuffer.setLen(msg.msg_iov.iov_len)
|
# FIXME: This will not work on FreeBSD as recvmsg(2) says:
|
||||||
|
# recvmmsg() returns the number of messages received
|
||||||
|
dataBuffer.setLen(res)
|
||||||
retFuture.complete((dataBuffer, ancillaryData))
|
retFuture.complete((dataBuffer, ancillaryData))
|
||||||
|
|
||||||
addRead(fd, cb)
|
addRead(fd, cb)
|
||||||
|
|
Loading…
Reference in New Issue