From f39440e060ffa94fd572568a717284fa0f8f3fca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 24 Jun 2005 00:05:41 +0000 Subject: r7857: improved the handling of end-of-file on sockets in the smb server (This used to be commit 6ee98c5f6505824826955f9d60a7964471fa6c26) --- source4/smb_server/smb_server.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4/smb_server') diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 7e0aa2c0cb..f891fd892c 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -101,9 +101,12 @@ static NTSTATUS receive_smb_request(struct smbsrv_connection *smb_conn) if (NT_STATUS_IS_ERR(status)) { return status; } - if (nread == 0) { + if (!NT_STATUS_IS_OK(status)) { return NT_STATUS_OK; } + if (nread == 0) { + return NT_STATUS_END_OF_FILE; + } req->in.size += nread; /* when we have a full NBT header, then allocate the packet */ @@ -129,9 +132,12 @@ static NTSTATUS receive_smb_request(struct smbsrv_connection *smb_conn) if (NT_STATUS_IS_ERR(status)) { return status; } - if (nread == 0) { + if (!NT_STATUS_IS_OK(status)) { return NT_STATUS_OK; } + if (nread == 0) { + return NT_STATUS_END_OF_FILE; + } req->in.size += nread; -- cgit