Browse Source

If authentication fails, don't accept client messages on that socket

Sajin Sasy 1 year ago
parent
commit
a6eb344280
1 changed files with 5 additions and 1 deletions
  1. 5 1
      App/net.cpp

+ 5 - 1
App/net.cpp

@@ -241,7 +241,11 @@ void NetIO::authenticate_new_client(tcp::socket* csocket,
 
             // Receive client message bundles on this socket
             // for client sim_id c_simid
-            receive_msgbundle(csocket, c_simid);
+            if(ret) {
+                receive_msgbundle(csocket, c_simid);
+            } else{
+                delete(csocket);
+            }
         }
     });
     start_accept();