]> git.pond.sub.org Git - empserver/commitdiff
(player_main): Add empth_yield() in the command processing loop to ensure
authorRon Koenderink <rkoenderink@yahoo.ca>
Sat, 23 Jul 2005 13:37:36 +0000 (13:37 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sat, 23 Jul 2005 13:37:36 +0000 (13:37 +0000)
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.

src/lib/player/player.c

index abf188784a573389db39be3c6a07a3bfdfac8373..aa0f358cd9987b3be334ecd891a84fc202890703 100644 (file)
@@ -136,6 +136,7 @@ player_main(struct player *p)
        if (command() == 0 && !player->aborted)
            break;
        player->aborted = 0;
+       empth_yield();
     }
     /* #*# I put the following line in to prevent server crash -KHS */
     natp = getnatp(player->cnum);