r24744: Increase length by what we got from recv, not from ioctl
authorVolker Lendecke <vlendec@samba.org>
Tue, 28 Aug 2007 15:09:47 +0000 (15:09 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:17 +0000 (12:30 -0500)
(This used to be commit 23c8f4f74bfb761894034ce9375258411c80d74d)

source3/lib/packet.c

index a3a33643ff87ee8e28d10fe41941282e75fd0a47..c5335bcf15ec1c72a80a6ab75c97251a936a2275 100644 (file)
@@ -83,6 +83,8 @@ NTSTATUS packet_fd_read(struct packet_context *ctx)
                return NT_STATUS_NO_MEMORY;
        }
 
+       ctx->in.data = in;
+
        res = recv(ctx->fd, in + ctx->in.length, available, 0);
 
        if (res < 0) {
@@ -94,8 +96,7 @@ NTSTATUS packet_fd_read(struct packet_context *ctx)
                return NT_STATUS_END_OF_FILE;
        }
 
-       ctx->in.data = in;
-       ctx->in.length += available;
+       ctx->in.length += res;
 
        return NT_STATUS_OK;
 }