Fix treatment of EOF from player
Commit79407e68
(v4.3.11) changed recvclient() to keep failing after receiving EOF from player. This was bad, because some places getting input check player->aborted instead of recvclient() failure, and player->aborted wasn't set on EOF. Bugs caused by this: * comm_bomb(), ship_bomb(), plane_bomb(), land_bomb() went into an infinite loop that eventually ate all memory. * deli(), desi(), dist(), fly(), morale(), zdon(), att_prompt(), ask_move_in() interpreted EOF as empty input instead of no more input. * cmd_sail_ship() dereferenced a null pointer. Fix by setting player->aborted on EOF, too. (cherry picked from commitb3a7a8ee11
)
This commit is contained in:
parent
80b57b2f95
commit
b9b0710128
3 changed files with 8 additions and 7 deletions
|
@ -111,7 +111,7 @@ player_main(struct player *p)
|
|||
|
||||
while (status()) {
|
||||
command();
|
||||
player->aborted = 0;
|
||||
player->aborted = player->eof;
|
||||
empth_yield();
|
||||
}
|
||||
/* #*# I put the following line in to prevent server crash -KHS */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue