diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-02-17 12:01:12 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-02-21 11:48:12 +0100 |
commit | 52ccb40d595fc80bfa53b0b9cd75ffb902369681 (patch) | |
tree | f2cd180bc20262f1d7a76652720d9325b9ccff31 /source3/smbd/smb2_server.c | |
parent | 58c71bee40bb91868fc69d8f7fa640db0e33efae (diff) | |
download | samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.tar.gz samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.tar.xz samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.zip |
s3:smbd: maintain smbd_server_connection->status
If this isn't NT_STATUS_OK, we skip any io on the socket.
This avoids possible problems during shutdown.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/smbd/smb2_server.c')
-rw-r--r-- | source3/smbd/smb2_server.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index fe42ac99f99..5e6bfd95cac 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -2841,6 +2841,13 @@ static NTSTATUS smbd_smb2_request_next_incoming(struct smbd_server_connection *s size_t max_send_queue_len; size_t cur_send_queue_len; + if (!NT_STATUS_IS_OK(sconn->status)) { + /* + * we're not supposed to do any io + */ + return NT_STATUS_OK; + } + if (state->req != NULL) { /* * if there is already a tstream_readv_pdu @@ -3087,6 +3094,15 @@ static NTSTATUS smbd_smb2_io_handler(struct smbd_server_connection *sconn, NTSTATUS status; NTTIME now; + if (!NT_STATUS_IS_OK(sconn->status)) { + /* + * we're not supposed to do any io + */ + TEVENT_FD_NOT_READABLE(sconn->smb2.fde); + TEVENT_FD_NOT_WRITEABLE(sconn->smb2.fde); + return NT_STATUS_OK; + } + if (fde_flags & TEVENT_FD_WRITE) { status = smbd_smb2_flush_send_queue(sconn); if (!NT_STATUS_IS_OK(status)) { |