Explorar o código

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

Sajin Sasy hai 1 ano
pai
achega
a6eb344280
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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();