summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-03-05 15:40:49 +0100
committerVolker Lendecke <vl@samba.org>2012-03-05 15:59:36 +0100
commit216769f2ce7d18a7ca83bf440b6efd7ad4675675 (patch)
tree7995bf8400e92d3afcbcfe9fc6abfdbd08f42b64 /source3/smbd/reply.c
parent82b948a8160e3b5bb80238413967ed7f5798a35c (diff)
downloadsamba-216769f2ce7d18a7ca83bf440b6efd7ad4675675.tar.gz
samba-216769f2ce7d18a7ca83bf440b6efd7ad4675675.tar.bz2
samba-216769f2ce7d18a7ca83bf440b6efd7ad4675675.zip
s3: Move the drain_socket on error to reply_write_and_X
That's the only case where this can happen, so we should not clutter the main code path.
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6e6e73f584..e3a3766239 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -4647,6 +4647,15 @@ void reply_write_and_X(struct smb_request *req)
return;
out:
+ if (req->unread_bytes) {
+ /* writeX failed. drain socket. */
+ if (drain_socket(req->sconn->sock, req->unread_bytes) !=
+ req->unread_bytes) {
+ smb_panic("failed to drain pending bytes");
+ }
+ req->unread_bytes = 0;
+ }
+
END_PROFILE(SMBwriteX);
return;
}