summaryrefslogtreecommitdiffstats
path: root/lib/vty_io.c
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-28 12:20:52 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-28 12:20:52 +0100
commit4876784d99d81f66b07f9806ef5660d6cc229e58 (patch)
treebcca6c8941f24cb94e656447c5f690152d43c34e /lib/vty_io.c
parent6c2482c466aa420875f330893dc36101c3e7fd46 (diff)
downloadquagga-4876784d99d81f66b07f9806ef5660d6cc229e58.tar.bz2
quagga-4876784d99d81f66b07f9806ef5660d6cc229e58.tar.xz
Fix vty being closed while waiting on '--more--' prompt.
The vty_half_close() did not properly take care of the CLI state when in "cli_more_wait" state. This fix tests for cli_more_wait state in vty_half_close() and explicitly exits that state. (Instead of letting the state be cleared implicitly, which didn't quite tidy up quickly enough.)
Diffstat (limited to 'lib/vty_io.c')
-rw-r--r--lib/vty_io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/vty_io.c b/lib/vty_io.c
index c4b4f528..9fd9ff2a 100644
--- a/lib/vty_io.c
+++ b/lib/vty_io.c
@@ -716,11 +716,13 @@ uty_half_close (vty_io vio, const char* reason)
/* Turn off "--more--" so that all output clears without interruption.
*
- * Note that if is waiting for "--more--", then shutting the read side
- * causes it to be readable, but EOF -- so that will flush through.
+ * If is sitting on a "--more--" prompt, then exit the wait_more CLI.
*/
vio->cli_more_enabled = 0 ;
+ if (vio->cli_more_wait)
+ uty_cli_exit_more_wait(vio) ;
+
/* If a command is not in progress, enable output, which will clear
* the output buffer if there is anything there, plus any close reason,
* and then close.
@@ -1696,7 +1698,7 @@ uty_write_fifo_lc(vty_io vio, vio_fifo vf, vio_line_control lc)
* cleared.
*/
if (lc->paused && vio->cli_more_enabled)
- uty_cli_go_more_wait(vio) ;
+ uty_cli_enter_more_wait(vio) ;
return 1 ; /* FIFO or line control, not empty */
} ;