summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-05-12 13:51:25 +0800
committerStefan Metzmacher <metze@samba.org>2009-05-13 18:27:41 +0200
commit6ff09b323e1bb3b82a27f6015ba94ccce36993af (patch)
tree0458fbd82e059dba3d8dd4471334a4ad80b7a2af /source3
parent83ff460401dd3ebd4daed5cb5f611adf44e184da (diff)
downloadsamba-6ff09b323e1bb3b82a27f6015ba94ccce36993af.tar.gz
samba-6ff09b323e1bb3b82a27f6015ba94ccce36993af.tar.bz2
samba-6ff09b323e1bb3b82a27f6015ba94ccce36993af.zip
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
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/async_smb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 0d82894bdc..77ef87785f 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<num_reqs; i++) {
@@ -1039,7 +1040,8 @@ bool cli_smb_chain_send(struct tevent_req **reqs, int num_reqs)
chain_padding = next_padding;
}
- if (!NT_STATUS_IS_OK(cli_smb_req_iov_send(reqs[0], last_state, iov, iovlen))) {
+ status = cli_smb_req_iov_send(reqs[0], last_state, iov, iovlen);
+ if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
return true;