Explorar el Código

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

Sajin Sasy hace 1 año
padre
commit
a6eb344280
Se han modificado 1 ficheros con 5 adiciones y 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();