diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-23 08:19:38 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:07 -0500 |
commit | 0e9c55e70f7720d1c424867bd8054859847e84fa (patch) | |
tree | f4103d8cc0cad2edeeb9ca66225bbe42541c1f30 /source4/libcli | |
parent | 0db8b5a949dd84966c21828bc91cd9d54b082b71 (diff) | |
download | samba-0e9c55e70f7720d1c424867bd8054859847e84fa.tar.gz samba-0e9c55e70f7720d1c424867bd8054859847e84fa.tar.bz2 samba-0e9c55e70f7720d1c424867bd8054859847e84fa.zip |
r4937: simplify the connect code in the same way
(This used to be commit 347dfa47249d55c61e1e7c82d10444a71aca8a85)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/composite/connect.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/source4/libcli/composite/connect.c b/source4/libcli/composite/connect.c index 67123a3af5..83f1dc4fa6 100644 --- a/source4/libcli/composite/connect.c +++ b/source4/libcli/composite/connect.c @@ -92,9 +92,6 @@ static NTSTATUS connect_tcon(struct smbcli_composite *c, /* all done! */ c->state = SMBCLI_REQUEST_DONE; - if (c->async.fn) { - c->async.fn(c); - } return NT_STATUS_OK; } @@ -277,35 +274,35 @@ static NTSTATUS connect_resolve(struct smbcli_composite *c, static void state_handler(struct smbcli_composite *c) { struct connect_state *state = talloc_get_type(c->private, struct connect_state); - NTSTATUS status; switch (state->stage) { case CONNECT_RESOLVE: - status = connect_resolve(c, state->io); + c->status = connect_resolve(c, state->io); break; case CONNECT_SOCKET: - status = connect_socket(c, state->io); + c->status = connect_socket(c, state->io); break; case CONNECT_SESSION_REQUEST: - status = connect_session_request(c, state->io); + c->status = connect_session_request(c, state->io); break; case CONNECT_NEGPROT: - status = connect_negprot(c, state->io); + c->status = connect_negprot(c, state->io); break; case CONNECT_SESSION_SETUP: - status = connect_session_setup(c, state->io); + c->status = connect_session_setup(c, state->io); break; case CONNECT_TCON: - status = connect_tcon(c, state->io); + c->status = connect_tcon(c, state->io); break; } - if (!NT_STATUS_IS_OK(status)) { - c->status = status; + if (!NT_STATUS_IS_OK(c->status)) { c->state = SMBCLI_REQUEST_ERROR; - if (c->async.fn) { - c->async.fn(c); - } + } + + if (c->state >= SMBCLI_REQUEST_DONE && + c->async.fn) { + c->async.fn(c); } } |