diff options
author | Volker Lendecke <vl@samba.org> | 2013-04-09 12:15:02 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-04-12 03:07:10 +0200 |
commit | 237ec2fbac4c69f642eab481813350fb9568ebaf (patch) | |
tree | a0ba7f65b370eed2dd5697fa6c0dcd25e48fe606 /source3 | |
parent | cd2cc97df214a284c55fc5bf43d17aab10808d95 (diff) | |
download | samba-237ec2fbac4c69f642eab481813350fb9568ebaf.tar.gz samba-237ec2fbac4c69f642eab481813350fb9568ebaf.tar.bz2 samba-237ec2fbac4c69f642eab481813350fb9568ebaf.zip |
libsmbclient: Use async cli_full_connection in python connection setup
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 12 03:07:10 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/pylibsmb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 2b253f9d19..ae0d6943d0 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -408,6 +408,7 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args, char *host, *share; PyObject *creds = NULL; struct cli_credentials *cli_creds; + struct tevent_req *req; bool ret; static const char *kwlist[] = { @@ -440,12 +441,18 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args, cli_creds = PyCredentials_AsCliCredentials(creds); } - status = cli_full_connection( - &self->cli, "myname", host, NULL, 0, share, "?????", + req = cli_full_connection_send( + NULL, self->ev, "myname", host, NULL, 0, share, "?????", cli_credentials_get_username(cli_creds), cli_credentials_get_domain(cli_creds), cli_credentials_get_password(cli_creds), 0, 0); + if (!py_tevent_req_wait_exc(self->ev, req)) { + return NULL; + } + status = cli_full_connection_recv(req, &self->cli); + TALLOC_FREE(req); + if (!NT_STATUS_IS_OK(status)) { PyErr_SetNTSTATUS(status); return -1; |