diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-24 00:05:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:43 -0500 |
commit | f39440e060ffa94fd572568a717284fa0f8f3fca (patch) | |
tree | bc25522e95e2e2093de1a8e074e9184bef2d4652 /source4 | |
parent | 21d6a163a30d2eac0e048c8ebc02cb48213ac543 (diff) | |
download | samba-f39440e060ffa94fd572568a717284fa0f8f3fca.tar.gz samba-f39440e060ffa94fd572568a717284fa0f8f3fca.tar.bz2 samba-f39440e060ffa94fd572568a717284fa0f8f3fca.zip |
r7857: improved the handling of end-of-file on sockets in the smb server
(This used to be commit 6ee98c5f6505824826955f9d60a7964471fa6c26)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/smb_server/smb_server.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; |