diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-10-04 13:56:20 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-10-04 13:56:20 -0700 |
commit | e44369989c54e908e3481fb76444df6bcf4e228b (patch) | |
tree | d03f0f366118977a272f099588d91b3985e0281c /source3/client/client.c | |
parent | ba5ef49f831dbbfec1a360cd4644999de822e2bc (diff) | |
parent | 80665a0b5abbdd8df735e1ccdab3206399beba0b (diff) | |
download | samba-e44369989c54e908e3481fb76444df6bcf4e228b.tar.gz samba-e44369989c54e908e3481fb76444df6bcf4e228b.tar.bz2 samba-e44369989c54e908e3481fb76444df6bcf4e228b.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/client/client.c')
-rw-r--r-- | source3/client/client.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 7af7d30108..eb9f31bdf2 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4345,6 +4345,8 @@ cleanup: } } +static bool finished; + /**************************************************************************** Make sure we swallow keepalives during idle time. ****************************************************************************/ @@ -4391,6 +4393,8 @@ static void readline_callback(void) DEBUG(0, ("Read from server failed, maybe it closed " "the connection\n")); + finished = true; + smb_readline_done(); if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) { set_smb_read_error(&cli->smb_rw_error, SMB_READ_EOF); @@ -4417,9 +4421,17 @@ static void readline_callback(void) /* Ping the server to keep the connection alive using SMBecho. */ { + NTSTATUS status; unsigned char garbage[16]; memset(garbage, 0xf0, sizeof(garbage)); - cli_echo(cli, 1, data_blob_const(garbage, sizeof(garbage))); + status = cli_echo(cli, 1, data_blob_const(garbage, sizeof(garbage))); + + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("SMBecho failed. Maybe server has closed " + "the connection\n")); + finished = true; + smb_readline_done(); + } } } @@ -4431,7 +4443,7 @@ static int process_stdin(void) { int rc = 0; - while (1) { + while (!finished) { TALLOC_CTX *frame = talloc_stackframe(); char *tok = NULL; char *the_prompt = NULL; |