diff options
author | Karolin Seeger <kseeger@samba.org> | 2008-11-17 14:02:52 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-11-17 14:02:52 +0100 |
commit | 62f7a2da9921071ab1877e43eac6b82c035c4806 (patch) | |
tree | eafabfe134305b5493b83efa4a5608287d87fb39 | |
parent | 4d7b05ab9509a9c38b0c98d879928f6c4acc304a (diff) | |
download | samba-62f7a2da9921071ab1877e43eac6b82c035c4806.tar.gz samba-62f7a2da9921071ab1877e43eac6b82c035c4806.tar.xz samba-62f7a2da9921071ab1877e43eac6b82c035c4806.zip |
Revert "Correctly fix smbclient to terminate on eof from server."
This reverts commit 28fa519a80bfcd30737a51ad157d134322c1fed9.
-rw-r--r-- | source/client/client.c | 13 | ||||
-rw-r--r-- | source/lib/readline.c | 13 |
2 files changed, 3 insertions, 23 deletions
diff --git a/source/client/client.c b/source/client/client.c index dc5e0f5359d..d794f8fe53d 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -4342,8 +4342,6 @@ cleanup: } } -static bool finished; - /**************************************************************************** Make sure we swallow keepalives during idle time. ****************************************************************************/ @@ -4390,8 +4388,6 @@ 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); @@ -4420,12 +4416,7 @@ static void readline_callback(void) { unsigned char garbage[16]; memset(garbage, 0xf0, sizeof(garbage)); - if (!cli_echo(cli, 1, garbage, sizeof(garbage))) { - DEBUG(0, ("SMBecho failed. Maybe server has closed " - "the connection\n")); - smb_readline_done(); - finished = true; - } + cli_echo(cli, 1, garbage, sizeof(garbage)); } } @@ -4437,7 +4428,7 @@ static int process_stdin(void) { int rc = 0; - while (!finished) { + while (1) { TALLOC_CTX *frame = talloc_stackframe(); char *tok = NULL; char *the_prompt = NULL; diff --git a/source/lib/readline.c b/source/lib/readline.c index fd57799b578..254f55c86a1 100644 --- a/source/lib/readline.c +++ b/source/lib/readline.c @@ -45,16 +45,6 @@ # define RL_COMPLETION_CAST #endif /* HAVE_NEW_LIBREADLINE */ -static bool smb_rl_done; - -void smb_readline_done(void) -{ - smb_rl_done = true; -#if HAVE_LIBREADLINE - rl_done = 1; -#endif -} - /**************************************************************************** Display the prompt and wait for input. Call callback() regularly ****************************************************************************/ @@ -79,7 +69,7 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void) return NULL; } - while (!smb_rl_done) { + while (1) { timeout.tv_sec = 5; timeout.tv_usec = 0; @@ -97,7 +87,6 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void) callback(); } } - return NULL; } /**************************************************************************** |