summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-09 12:15:02 +0200
committerJeremy Allison <jra@samba.org>2013-04-12 03:07:10 +0200
commit237ec2fbac4c69f642eab481813350fb9568ebaf (patch)
treea0ba7f65b370eed2dd5697fa6c0dcd25e48fe606 /source3/libsmb
parentcd2cc97df214a284c55fc5bf43d17aab10808d95 (diff)
downloadsamba-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/libsmb')
-rw-r--r--source3/libsmb/pylibsmb.c11
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;