Change recvclient() to treat io_error() like io_eof()
This is for consistency with status() and player_login().
This commit is contained in:
parent
49c24d7b78
commit
b7153d095c
1 changed files with 5 additions and 7 deletions
|
@ -47,10 +47,10 @@
|
||||||
* Else receive one line and store it in CMD[SIZE].
|
* Else receive one line and store it in CMD[SIZE].
|
||||||
* This may block for input, yielding the processor. Flush buffered
|
* This may block for input, yielding the processor. Flush buffered
|
||||||
* output when blocking, to make sure player sees the prompt.
|
* output when blocking, to make sure player sees the prompt.
|
||||||
* If the player's connection has the I/O error indicator set, or the
|
* If the player's connection has the I/O error or EOF indicator set,
|
||||||
* line is "aborted", set the player's aborted flag and return -2.
|
* or the line is "ctld", set the player's eof flag and return -1.
|
||||||
* If the player's connection has the EOF indicator set, or the line
|
* If the line is "aborted", set the player's aborted flag and return
|
||||||
* is "ctld", set the player's eof flag and return -1.
|
* -2.
|
||||||
* Else return the length of the line.
|
* Else return the length of the line.
|
||||||
* Design bug: there is no way to indicate truncation of a long 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 */
|
/* Await more input */
|
||||||
io_input(player->iop, IO_WAIT);
|
io_input(player->iop, IO_WAIT);
|
||||||
if (io_error(player->iop))
|
if (io_error(player->iop) || io_eof(player->iop))
|
||||||
player->aborted = 1;
|
|
||||||
else if (io_eof(player->iop))
|
|
||||||
player->eof = 1;
|
player->eof = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue