[enet-cvs]CVS: enet protocol.c,1.15,1.16

Lee Salzman enet at sferik.cubik.org
Thu May 22 17:35:14 PDT 2003


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

Modified Files:
	protocol.c 
Log Message:
Added support for buffer limits


Index: protocol.c
===================================================================
RCS file: /home/enet/cvsroot/enet/protocol.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- protocol.c	2003/05/20 12:59:56	1.15
+++ protocol.c	2003/05/22 22:35:12	1.16
@@ -669,6 +669,7 @@
     while (currentAcknowledgement != enet_list_end (& peer -> acknowledgements))
     {
        if (command >= & host -> commands [sizeof (host -> commands) / sizeof (ENetProtocol)] ||
+           buffer >= & host -> buffers [sizeof (host -> buffers) / sizeof (ENetBuffer)] ||
            peer -> mtu - host -> packetSize < sizeof (ENetProtocolAcknowledge))
          break;
 
@@ -717,6 +718,7 @@
        outgoingCommand = (ENetOutgoingCommand *) currentCommand;
 
        if (command >= & host -> commands [sizeof (host -> commands) / sizeof (ENetProtocol)] ||
+           buffer + 1 >= & host -> buffers [sizeof (host -> buffers) / sizeof (ENetBuffer)] ||
            peer -> mtu - host -> packetSize < outgoingCommand -> command.header.commandLength ||
            (outgoingCommand -> packet != NULL &&
              peer -> mtu - host -> packetSize < outgoingCommand -> command.header.commandLength + 
@@ -843,6 +845,7 @@
        outgoingCommand = (ENetOutgoingCommand *) currentCommand;
 
        if (command >= & host -> commands [sizeof (host -> commands) / sizeof (ENetProtocol)] ||
+           buffer + 1 >= & host -> buffers [sizeof (host -> buffers) / sizeof (ENetBuffer)] ||
            peer -> mtu - host -> packetSize < outgoingCommand -> command.header.commandLength)
          break;
 



More information about the enet-cvs mailing list