From 6ff09b323e1bb3b82a27f6015ba94ccce36993af Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Tue, 12 May 2009 13:51:25 +0800 Subject: [PATCH] s3:libsmb: return NT_STATUS_CONNECTION_INVALID if the fd is -1 This way we can destinguish between requests which failed because the connection broke after they were triggered and the requests which are started on an already broken connection. This also moves the check to cli_smb_req_iov_send() where it really belongs. metze --- source3/libsmb/async_smb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 0d82894bdc7..77ef87785f5 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -547,6 +547,10 @@ static NTSTATUS cli_smb_req_iov_send(struct tevent_req *req, struct tevent_req *subreq; NTSTATUS status; + if (state->cli->fd == -1) { + return NT_STATUS_CONNECTION_INVALID; + } + if (iov[0].iov_len < smb_wct) { return NT_STATUS_INVALID_PARAMETER; } @@ -606,10 +610,6 @@ NTSTATUS cli_smb_req_send(struct tevent_req *req) struct cli_smb_state *state = tevent_req_data( req, struct cli_smb_state); - if (state->cli->fd == -1) { - return NT_STATUS_CONNECTION_DISCONNECTED; - } - return cli_smb_req_iov_send(req, state, state->iov, state->iov_count); } @@ -963,6 +963,7 @@ bool cli_smb_chain_send(struct tevent_req **reqs, int num_reqs) int i, iovlen; struct iovec *iov = NULL; struct iovec *this_iov; + NTSTATUS status; iovlen = 0; for (i=0; i