From 6ef4e7d277a4f9e97e24e3f3b77835f584acd9a1 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 29 Sep 2014 15:49:34 +0300 Subject: [PATCH] limit number of packets that can be received per iteration of protocol loop --- protocol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocol.c b/protocol.c index 101d923..3a7dd36 100644 --- a/protocol.c +++ b/protocol.c @@ -1191,7 +1191,9 @@ commandError: static int enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) { - for (;;) + int packets; + + for (packets = 0; packets < 256; ++ packets) { int receivedLength; ENetBuffer buffer;