summaryrefslogtreecommitdiffstats
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
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 6e6e73f5846..e3a3766239a 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;
}