log authenitcation

This commit is contained in:
soruh 2023-03-19 00:49:53 +01:00
parent 60fedabb01
commit 056e710c4c

View File

@ -23,6 +23,8 @@ pub async fn connection_handler(
port_handler: &Mutex<PortHandler>,
stream: &mut TcpStream,
) -> anyhow::Result<()> {
let addr = stream.peer_addr()?;
let (mut reader, mut writer) = stream.split();
let mut packet = Packet::default();
@ -48,8 +50,6 @@ pub async fn connection_handler(
.await
.allocate_port_for_number(config, number);
info!(port, "allocated port");
let Some(port) = port else {
writer.write_all(REJECT_OOP).await?;
return Ok(());
@ -105,6 +105,8 @@ pub async fn connection_handler(
};
};
info!(number, port, %addr, "authenticated");
let listener = handler_metadata.listener.as_mut().unwrap(); // we only break from the loop if this is set
packet.header = Header {