summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-22 09:39:23 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-22 17:06:07 +0200
commit6d1757f1893e8f15c645eca44377de2f5a67232a (patch)
tree0b0077005c9c62eb4a2fb0fad3cab8f429d9e9f7 /source3
parent103413da8bd60f1d0dce7c1338db8d6ace312828 (diff)
downloadsamba-6d1757f1893e8f15c645eca44377de2f5a67232a.tar.gz
samba-6d1757f1893e8f15c645eca44377de2f5a67232a.tar.bz2
samba-6d1757f1893e8f15c645eca44377de2f5a67232a.zip
s3:libsmb: make use of cli_state_disconnect()
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/async_smb.c13
-rw-r--r--source3/libsmb/clientgen.c5
2 files changed, 4 insertions, 14 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index aac303c22e..724e8b7d4f 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -489,10 +489,7 @@ static void cli_smb_sent(struct tevent_req *subreq)
nwritten = writev_recv(subreq, &err);
TALLOC_FREE(subreq);
if (nwritten == -1) {
- if (state->cli->fd != -1) {
- close(state->cli->fd);
- state->cli->fd = -1;
- }
+ cli_state_disconnect(state->cli);
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}
@@ -537,10 +534,7 @@ static void cli_smb_received(struct tevent_req *subreq)
received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
TALLOC_FREE(subreq);
if (received == -1) {
- if (cli->fd != -1) {
- close(cli->fd);
- cli->fd = -1;
- }
+ cli_state_disconnect(cli);
status = map_nt_error_from_unix(err);
goto fail;
}
@@ -620,8 +614,7 @@ static void cli_smb_received(struct tevent_req *subreq)
DEBUG(10, ("cli_check_sign_mac failed\n"));
TALLOC_FREE(inbuf);
status = NT_STATUS_ACCESS_DENIED;
- close(cli->fd);
- cli->fd = -1;
+ cli_state_disconnect(cli);
goto fail;
}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index c394197ad9..7a417ec6c0 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -321,10 +321,7 @@ static void _cli_shutdown(struct cli_state *cli)
data_blob_free(&cli->secblob);
data_blob_free(&cli->user_session_key);
- if (cli->fd != -1) {
- close(cli->fd);
- }
- cli->fd = -1;
+ cli_state_disconnect(cli);
/*
* Need to free pending first, they remove themselves