warn instead of erroring when a client fails to send an authentication request

This commit is contained in:
soruh 2023-06-20 18:33:50 +02:00
parent 7b9582d518
commit 2e8496ae37
2 changed files with 11 additions and 2 deletions

View File

@ -10,7 +10,7 @@ use tokio::{
sync::Mutex,
time::{sleep, timeout},
};
use tracing::{info, instrument, trace};
use tracing::{info, instrument, trace, warn};
use crate::{
auth::dyn_ip_update,
@ -329,6 +329,12 @@ pub async fn handler(
};
res?;
if packet.kind() != PacketKind::RemConfirm {
let kind = packet.kind();
warn!(%addr, ?kind, "client sent unexpected packet instead of RemConnect");
return Ok(());
}
let RemConnect { number, pin } = packet.as_rem_connect()?;
handler_metadata.number = Some(number);

View File

@ -256,7 +256,10 @@ async fn connection_handler(
}
_ => Some(err.to_string()),
},
Ok(Ok(())) => None,
Ok(Ok(())) => {
debug!(%addr, "finished handling client");
None
}
};
if let Some(error) = error {