allow ping before RemAck

This commit is contained in:
2023-03-20 15:46:34 +01:00
parent a5c73993d3
commit 6f1e9836c0

View File

@@ -346,8 +346,11 @@ pub async fn handler(
return Ok(());
};
let notify_at = Instant::now();
loop {
let recv = timeout(
CALL_ACK_TIMEOUT,
CALL_ACK_TIMEOUT.saturating_sub(notify_at.elapsed()),
packet.recv_into_cancelation_safe(&mut reader),
);
@@ -358,6 +361,7 @@ pub async fn handler(
res?;
match packet.kind() {
PacketKind::Ping => {}
PacketKind::End | PacketKind::Reject => {
port_handler.lock().await.start_rejector(
port,
@@ -368,7 +372,7 @@ pub async fn handler(
packet,
);
Ok(())
return Ok(());
}
PacketKind::RemAck => {
@@ -380,9 +384,12 @@ pub async fn handler(
client,
&mut caller,
)
.await
.await?;
return Ok(());
}
kind => Err(eyre!("unexpected packet: {:?}", kind)),
kind => return Err(eyre!("unexpected packet: {:?}", kind)),
}
}
}