diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-04-28 16:04:19 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-04-28 20:35:52 +0200 |
commit | 87d2537b485470ca0f0be882084d46deb682d5b8 (patch) | |
tree | c31ef3b5e0a4d39d615210cefa22efd529f61436 /source4/libcli/smb2 | |
parent | 2e5b539ba934e7269ea0c857b3df80434727acd2 (diff) | |
download | samba-87d2537b485470ca0f0be882084d46deb682d5b8.tar.gz samba-87d2537b485470ca0f0be882084d46deb682d5b8.tar.bz2 samba-87d2537b485470ca0f0be882084d46deb682d5b8.zip |
s4:libcli/smb2: move smb2_connect_resolve_done()
It should be after smb2_connect_send().
metze
Diffstat (limited to 'source4/libcli/smb2')
-rw-r--r-- | source4/libcli/smb2/connect.c | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c index 2c7da5f582..0d29577a32 100644 --- a/source4/libcli/smb2/connect.c +++ b/source4/libcli/smb2/connect.c @@ -226,39 +226,7 @@ static void smb2_connect_socket_done(struct composite_context *creq) smb2req->async.private_data = req; } -static void smb2_connect_resolve_done(struct composite_context *creq) -{ - struct tevent_req *req = - talloc_get_type_abort(creq->async.private_data, - struct tevent_req); - struct smb2_connect_state *state = - tevent_req_data(req, - struct smb2_connect_state); - NTSTATUS status; - const char *addr; - const char **ports; - const char *default_ports[] = { "445", NULL }; - - status = resolve_name_recv(creq, state, &addr); - if (tevent_req_nterror(req, status)) { - return; - } - - if (state->ports == NULL) { - ports = default_ports; - } else { - ports = state->ports; - } - - creq = smbcli_sock_connect_send(state, addr, ports, - state->host, state->resolve_ctx, - state->ev, state->socket_options); - if (tevent_req_nomem(creq, req)) { - return; - } - creq->async.fn = smb2_connect_socket_done; - creq->async.private_data = req; -} +static void smb2_connect_resolve_done(struct composite_context *creq); /* a composite function that does a full negprot/sesssetup/tcon, returning @@ -308,9 +276,40 @@ struct tevent_req *smb2_connect_send(TALLOC_CTX *mem_ctx, return req; } -/* - receive a connect reply -*/ +static void smb2_connect_resolve_done(struct composite_context *creq) +{ + struct tevent_req *req = + talloc_get_type_abort(creq->async.private_data, + struct tevent_req); + struct smb2_connect_state *state = + tevent_req_data(req, + struct smb2_connect_state); + NTSTATUS status; + const char *addr; + const char **ports; + const char *default_ports[] = { "445", NULL }; + + status = resolve_name_recv(creq, state, &addr); + if (tevent_req_nterror(req, status)) { + return; + } + + if (state->ports == NULL) { + ports = default_ports; + } else { + ports = state->ports; + } + + creq = smbcli_sock_connect_send(state, addr, ports, + state->host, state->resolve_ctx, + state->ev, state->socket_options); + if (tevent_req_nomem(creq, req)) { + return; + } + creq->async.fn = smb2_connect_socket_done; + creq->async.private_data = req; +} + NTSTATUS smb2_connect_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct smb2_tree **tree) |