shithub: choc

Download patch

ref: d5794db799a0aa47c227bf4e12b4ddaf2b4415ec
parent: 02ed6c1bb5b1fbdd6aa1d41b01e1c374d8c86e5d
author: Simon Howard <[email protected]>
date: Sun Jan 8 00:06:06 EST 2006

Reject new connections if the server is not in the waiting state.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 270

--- a/src/net_server.c
+++ b/src/net_server.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: net_server.c 268 2006-01-08 04:52:26Z fraggle $
+// $Id: net_server.c 270 2006-01-08 05:06:06Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -21,6 +21,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.16  2006/01/08 05:06:06  fraggle
+// Reject new connections if the server is not in the waiting state.
+//
 // Revision 1.15  2006/01/08 04:52:26  fraggle
 // Allow the server to reject clients
 //
@@ -241,6 +244,13 @@
 
     // received a valid SYN
 
+    // not accepting new connections?
+    
+    if (server_state != SERVER_WAITING_START)
+    {
+        NET_SV_SendReject(addr, "Server is not currently accepting connections");
+    }
+    
     // allocate a client slot if there isn't one already
 
     if (client == NULL)