Fixes sockets.recvFrom not setting length of data.

This commit is contained in:
Dominik Picheta 2012-09-23 01:31:49 +01:00
commit d00cb877fd

View file

@ -1229,6 +1229,7 @@ proc recvFrom*(socket: TSocket, data: var string, length: int,
cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen))
if result != -1: if result != -1:
data.setLen(result)
address = $inet_ntoa(sockAddress.sin_addr) address = $inet_ntoa(sockAddress.sin_addr)
port = ntohs(sockAddress.sin_port).TPort port = ntohs(sockAddress.sin_port).TPort