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.
This commit is contained in:
Markus Armbruster 2012-01-29 10:34:47 +01:00
parent ca7578f1b8
commit 0a7306a5ac

View file

@ -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;
}