(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:
Ron Koenderink 2005-07-23 13:37:36 +00:00
parent e332ff5fcc
commit db6fd8dad2

View file

@ -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);