]> git.pond.sub.org Git - empserver/commitdiff
Fix login command quit to really quit
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 Jan 2012 09:34:47 +0000 (10:34 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 21 Feb 2012 17:11:13 +0000 (18:11 +0100)
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

index d422001204e645f5650614af5b893334a67862db..d6a2b5424c99dc9e360499ac883aaa90f18f2b21 100644 (file)
@@ -382,6 +382,6 @@ kill_cmd(void)
 static int
 quit_cmd(void)
 {
 static int
 quit_cmd(void)
 {
-    io_shutdown(player->iop, IO_READ);
+    io_set_eof(player->iop);
     return RET_OK;
 }
     return RET_OK;
 }