rust/hedgewars-server/src/server/network.rs
changeset 14868 eef1f76150fe
parent 14856 57ed3981db20
child 14891 ce98c37826a7
--- a/rust/hedgewars-server/src/server/network.rs	Sat Apr 27 19:14:00 2019 +0200
+++ b/rust/hedgewars-server/src/server/network.rs	Sun Apr 28 00:09:56 2019 +0300
@@ -481,8 +481,11 @@
 
     fn init_client(&mut self, poll: &Poll, client_id: ClientId) {
         let mut response = handlers::Response::new(client_id);
-        #[cfg(feature = "tls-connections")]
-        response.add(Redirect(self.ssl.listener.local_addr().unwrap().port()).send_self());
+
+        if let ClientSocket::Plain(_) = self.clients[client_id].socket {
+            #[cfg(feature = "tls-connections")]
+            response.add(Redirect(self.ssl.listener.local_addr().unwrap().port()).send_self())
+        }
 
         handlers::handle_client_accept(&mut self.server, client_id, &mut response);
         self.handle_response(response, poll);