[enet-cvs] CVS: enet host.c,1.12,1.13

Lee Salzman enet at sferik.cubik.org
Sun Nov 16 09:36:40 PST 2003


Update of /home/enet/cvsroot/enet
In directory sferik:/tmp/cvs-serv15874

Modified Files:
	host.c 
Log Message:
small little throttle fix


Index: host.c
===================================================================
RCS file: /home/enet/cvsroot/enet/host.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- host.c	2003/10/30 15:55:31	1.12
+++ host.c	2003/11/16 17:36:37	1.13
@@ -325,6 +325,19 @@
                 peer < & host -> peers [host -> peerCount];
                 ++ peer)
            {
+                if (host -> outgoingBandwidth == 0)
+                  peer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
+                else
+                  peer -> windowSize = (bandwidthLimit /
+                                         ENET_PEER_WINDOW_SIZE_SCALE) 
+                                           * ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
+
+                if (peer -> windowSize < ENET_PROTOCOL_MINIMUM_WINDOW_SIZE)
+                  peer -> windowSize = ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
+                else
+                if (peer -> windowSize > ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE)
+                  peer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
+
                if (peer -> state != ENET_PEER_STATE_CONNECTED ||
                    peer -> incomingBandwidthThrottleEpoch == timeCurrent)
                  continue;



More information about the enet-cvs mailing list