rust/hedgewars-server/src/server/network.rs
changeset 14891 ce98c37826a7
parent 14868 eef1f76150fe
child 14928 c156273b57de
--- a/rust/hedgewars-server/src/server/network.rs	Wed May 01 00:13:23 2019 +0200
+++ b/rust/hedgewars-server/src/server/network.rs	Wed May 01 16:37:47 2019 +0300
@@ -492,17 +492,20 @@
     }
 
     pub fn accept_client(&mut self, poll: &Poll, server_token: mio::Token) -> io::Result<()> {
-        let (client_socket, addr) = self.listener.accept()?;
-        info!("Connected: {}", addr);
+
 
         match server_token {
             utils::SERVER_TOKEN => {
+                let (client_socket, addr) = self.listener.accept()?;
+                info!("Connected(plaintext): {}", addr);
                 let client_id =
                     self.register_client(poll, self.create_client_socket(client_socket)?, addr);
                 self.init_client(poll, client_id);
             }
             #[cfg(feature = "tls-connections")]
             utils::SECURE_SERVER_TOKEN => {
+                let (client_socket, addr) = self.ssl.listener.accept()?;
+                info!("Connected(TLS): {}", addr);
                 self.register_client(poll, self.create_client_secure_socket(client_socket)?, addr);
             }
             _ => unreachable!(),