]> git.pond.sub.org Git - empserver/commitdiff
Change recvclient() to treat io_error() like io_eof()
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 15 Jul 2008 02:24:42 +0000 (22:24 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 15 Jul 2008 10:25:18 +0000 (06:25 -0400)
This is for consistency with status() and player_login().

src/lib/player/recvclient.c

index 72730cee6978f619fdf606bac11e9a5443a06e3e..f6e92f0dea355f7b8067449a4c5c0453a19c6e32 100644 (file)
  * Else receive one line and store it in CMD[SIZE].
  * This may block for input, yielding the processor.  Flush buffered
  * output when blocking, to make sure player sees the prompt.
- * If the player's connection has the I/O error indicator set, or the
- * line is "aborted", set the player's aborted flag and return -2.
- * If the player's connection has the EOF indicator set, or the line
- * is "ctld", set the player's eof flag and return -1.
+ * If the player's connection has the I/O error or EOF indicator set,
+ * or the line is "ctld", set the player's eof flag and return -1.
+ * If the line is "aborted", set the player's aborted flag and return
+ * -2.
  * Else return the length of the line.
  * Design bug: there is no way to indicate truncation of a long line.
  */
@@ -85,9 +85,7 @@ recvclient(char *cmd, int size)
 
        /* Await more input */
        io_input(player->iop, IO_WAIT);
-       if (io_error(player->iop))
-           player->aborted = 1;
-       else if (io_eof(player->iop))
+       if (io_error(player->iop) || io_eof(player->iop))
            player->eof = 1;
     }