From 0a7306a5ac9e207727ef38892c88cba4323a0deb Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 29 Jan 2012 10:34:47 +0100 Subject: [PATCH] Fix login command quit to really quit quit_cmd() calls io_shutdown() to make player_login()'s next command read detect EOF. io_shutdown() drains the input queue and shuts down the socket with shutdown(). player_login()'s next io_gets() fails all right, but then io_input() *can* read more from the socket on my Linux box, at least when I send plenty of input fast. Thus, we ignore whatever input after quit was already queued, then resume reading commands, not necessarily at the beginning of a line. Fix by setting the EOF indicator instead. --- src/lib/player/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/player/login.c b/src/lib/player/login.c index d42200120..d6a2b5424 100644 --- a/src/lib/player/login.c +++ b/src/lib/player/login.c @@ -382,6 +382,6 @@ kill_cmd(void) static int quit_cmd(void) { - io_shutdown(player->iop, IO_READ); + io_set_eof(player->iop); return RET_OK; } -- 2.43.0