diff options
-rw-r--r-- | source3/client/client.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 1daba28b98..0630bbb44b 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -2080,6 +2080,14 @@ static int process_command_string(char *cmd) char *ptr; int rc = 0; + /* establish the connection if not already */ + + if (!cli) { + cli = do_connect(desthost, service); + if (!cli) + return; + } + while (cmd[0] != '\0') { char *p; fstring tok; @@ -2484,9 +2492,13 @@ handle a tar operation static int do_tar_op(char *base_directory) { int ret; - cli = do_connect(desthost, service); - if (!cli) - return 1; + + /* do we already have a connection? */ + if (!cli) { + cli = do_connect(desthost, service); + if (!cli) + return 1; + } recurse=True; |