summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-03-12 17:59:24 -0700
committerJeremy Allison <jra@samba.org>2009-03-12 17:59:24 -0700
commite5136e984922570ce9992c642c340dd3e937fc4e (patch)
tree90acd50687e0adf2352eb1663b4934f01df0a9fc /source3/lib/netapi
parentbace42d586f2e4364e5b66ccc80a0b19749b5e1c (diff)
downloadsamba-e5136e984922570ce9992c642c340dd3e937fc4e.tar.gz
samba-e5136e984922570ce9992c642c340dd3e937fc4e.tar.bz2
samba-e5136e984922570ce9992c642c340dd3e937fc4e.zip
Remove the static "struct client_connection" mess which is part of
the problem that stops libsmbclient being thread safe. Subsidiary DFS connections are now hung off a list inside the cli_state struct. Much more to do in order to get libsmbclient to thread safety, but this is a good start. Jeremy.
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/cm.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index 233255fed4..43ebed6c22 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -73,19 +73,10 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
/********************************************************************
********************************************************************/
-WERROR libnetapi_shutdown_cm(struct libnetapi_ctx *ctx)
-{
- cli_cm_shutdown();
-
- return WERR_OK;
-}
-
-/********************************************************************
-********************************************************************/
-
struct client_pipe_connection {
struct client_pipe_connection *prev, *next;
struct rpc_pipe_client *pipe;
+ struct cli_state *cli;
};
static struct client_pipe_connection *pipe_connections;
@@ -93,6 +84,20 @@ static struct client_pipe_connection *pipe_connections;
/********************************************************************
********************************************************************/
+WERROR libnetapi_shutdown_cm(struct libnetapi_ctx *ctx)
+{
+ struct client_pipe_connection *p;
+
+ for (p = pipe_connections; p; p = p->next) {
+ cli_shutdown(p->cli);
+ }
+
+ return WERR_OK;
+}
+
+/********************************************************************
+********************************************************************/
+
static NTSTATUS pipe_cm_find(struct cli_state *cli,
const struct ndr_syntax_id *interface,
struct rpc_pipe_client **presult)
@@ -138,6 +143,7 @@ static NTSTATUS pipe_cm_connect(TALLOC_CTX *mem_ctx,
return status;
}
+ p->cli = cli;
DLIST_ADD(pipe_connections, p);
*presult = p->pipe;
@@ -193,5 +199,3 @@ WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
return WERR_OK;
}
-
-