]> git.lizzy.rs Git - connect-rs.git/commitdiff
add more debug stmts to tcp server
authorSachandhan Ganesh <sachan.ganesh@gmail.com>
Fri, 15 Jan 2021 20:37:41 +0000 (12:37 -0800)
committerSachandhan Ganesh <sachan.ganesh@gmail.com>
Fri, 15 Jan 2021 20:37:41 +0000 (12:37 -0800)
src/tcp/server.rs
src/tls/server.rs

index 43fd1dec1c0f6d1e468e6655afc452d81901826c..136c3f1a37e118308358f1111dc5f68d589cda25 100644 (file)
@@ -29,8 +29,14 @@ impl Stream for TcpServer {
 
     fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
         if let Some(Ok(conn)) = futures::executor::block_on(self.listener.incoming().next()) {
+            debug!(
+                "Received connection attempt from {}",
+                conn.peer_addr()
+                    .expect("Peer address could not be retrieved")
+            );
             Poll::Ready(Some(Connection::from(conn)))
         } else {
+            debug!("Shutting TCP server down at {}", self.local_addrs);
             Poll::Ready(None)
         }
     }
index 64e44c97512c961927973f85c914a796cbeb6d68..70a74231926b8f83559c932ace19e915b94904b7 100644 (file)
@@ -46,7 +46,7 @@ impl Stream for TlsServer {
             debug!("Received connection attempt from {}", peer_addr);
 
             if let Ok(tls_stream) = futures::executor::block_on(self.acceptor.accept(tcp_stream)) {
-                debug!("Established TLS connection from {}", peer_addr);
+                debug!("Completed TLS handshake with {}", peer_addr);
                 Poll::Ready(Some(Connection::from(TlsConnectionMetadata::Server {
                     local_addr,
                     peer_addr,