(player_main): Add empth_yield() in the command processing loop to ensure
after every command, other players gets a chance to execute a command. This prevents denial of service attack that monopolizing the active server thread by continuing feeding data to the server from a client.
This commit is contained in:
parent
e332ff5fcc
commit
db6fd8dad2
1 changed files with 1 additions and 0 deletions
|
@ -136,6 +136,7 @@ player_main(struct player *p)
|
||||||
if (command() == 0 && !player->aborted)
|
if (command() == 0 && !player->aborted)
|
||||||
break;
|
break;
|
||||||
player->aborted = 0;
|
player->aborted = 0;
|
||||||
|
empth_yield();
|
||||||
}
|
}
|
||||||
/* #*# I put the following line in to prevent server crash -KHS */
|
/* #*# I put the following line in to prevent server crash -KHS */
|
||||||
natp = getnatp(player->cnum);
|
natp = getnatp(player->cnum);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue