# HG changeset patch
# User alfadur
# Date 1556399396 -10800
# Node ID eef1f76150fe5555984c47f6e86745984094afc8
# Parent  75b515a6420217fdba4d88d3f7a75e44135e4df8
don't redirect to self

diff -r 75b515a64202 -r eef1f76150fe 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);