summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-15 13:06:20 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-05-26 03:31:28 +0200
commit13b36be68fb54d8e993aefe7b8b5e53f7316a126 (patch)
tree9a70760a8632d05be6acb41ed334f7c1cee716e0 /source4
parenta13eebac7dbc4c496e3784d2b31be89670dddb6d (diff)
downloadsamba-13b36be68fb54d8e993aefe7b8b5e53f7316a126.tar.gz
samba-13b36be68fb54d8e993aefe7b8b5e53f7316a126.tar.xz
samba-13b36be68fb54d8e993aefe7b8b5e53f7316a126.zip
s4:librpc/rpc: allow a shortcut in dcerpc_pipe_connect_ncacn_np_smb[2]_send()
If the caller provided smbXcli * pointers of an existing connection, we can use it. This will be used later in order to allow multiple dcerpc connections over the same smb connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index f779d1a9d70..ecb53150388 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -146,6 +146,11 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
s->io = *io;
conn = &s->conn;
+ if (smbXcli_conn_is_connected(s->io.smb.conn)) {
+ continue_smb_open(c);
+ return c;
+ }
+
/* prepare smb connection parameters: we're connecting to IPC$ share on
remote rpc server */
conn->in.dest_host = dcerpc_binding_get_string_option(s->io.binding, "host");
@@ -253,6 +258,11 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
s->io = *io;
+ if (smbXcli_conn_is_connected(s->io.smb.conn)) {
+ continue_smb_open(c);
+ return c;
+ }
+
host = dcerpc_binding_get_string_option(s->io.binding, "host");
flags = dcerpc_binding_get_flags(s->io.binding);