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

Lee Salzman enet at sferik.cubik.org
Sun Dec 14 18:13:10 PST 2003


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

Modified Files:
	peer.c 
Log Message:
small little check


Index: peer.c
===================================================================
RCS file: /home/enet/cvsroot/enet/peer.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- peer.c	2003/12/15 02:04:40	1.15
+++ peer.c	2003/12/15 02:13:07	1.16
@@ -417,9 +417,15 @@
     if (peer -> state == ENET_PEER_STATE_CONNECTED)
       command.header.flags |= ENET_PROTOCOL_FLAG_ACKNOWLEDGE;
     
-    peer -> state = ENET_PEER_STATE_DISCONNECTING;
-    
     enet_peer_queue_outgoing_command (peer, & command, NULL, 0, 0);
+
+    if (peer -> state == ENET_PEER_STATE_CONNECTED)
+      peer -> state = ENET_PEER_STATE_DISCONNECTING;
+    else
+    {
+        enet_host_flush (peer -> host);
+        enet_peer_reset (peer);
+    }
 }
 
 ENetAcknowledgement *



More information about the enet-cvs mailing list