rescue the stream on handshake failure
authoralfadur
Mon, 10 Sep 2018 23:53:59 +0300
changeset 13803 fea7c23d9c2c
parent 13802 24fe56d3c6a2
child 13804 201d86010a8b
rescue the stream on handshake failure
gameServer2/src/server/network.rs
--- a/gameServer2/src/server/network.rs	Mon Sep 10 23:31:44 2018 +0300
+++ b/gameServer2/src/server/network.rs	Mon Sep 10 23:53:59 2018 +0300
@@ -100,7 +100,8 @@
                 self.socket = ClientSocket::SslHandshake(Some(new_handshake));
                 Ok(NetworkClientState::Idle)
             }
-            Err(HandshakeError::Failure(_)) => {
+            Err(HandshakeError::Failure(new_handshake)) => {
+                self.socket = ClientSocket::SslHandshake(Some(new_handshake));
                 debug!("TLS handshake with {} ({}) failed", self.id, self.peer_addr);
                 Err(Error::new(ErrorKind::Other, "Connection failure"))
             }