From d907bcd57a7b23ceab919f32cb5c04c2500b4774 Mon Sep 17 00:00:00 2001 From: marcbou Date: Fri, 17 Aug 2007 05:55:24 +0000 Subject: [PATCH] lwip_recvfrom() tweaks. --- src/api/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index 7ddda23c..5afd109d 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -436,13 +436,13 @@ lwip_recvfrom(int s, void *mem, int len, unsigned int flags, /* copy the contents of the received buffer into the supplied memory pointer mem */ - netbuf_copy_partial(buf, (u8_t*)mem + off, copylen - off, sock->lastoffset); + netbuf_copy_partial(buf, (u8_t*)mem + off, copylen, sock->lastoffset); off += copylen; if (netconn_type(sock->conn) == NETCONN_TCP) { len -= copylen; - if ( (len <= 0) || (buf->p->flgs & PBUF_FLAG_PUSH) ) + if ( (len <= 0) || (buf->p->flgs & PBUF_FLAG_PUSH) || !sock->rcvevent) done = 1; } else