don't redirect to self
authoralfadur
Sun, 28 Apr 2019 00:09:56 +0300
changeset 14852 eef1f76150fe
parent 14851 75b515a64202
child 14853 bb412d8e435f
don't redirect to self
rust/hedgewars-server/src/server/network.rs
--- 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);