From b0d3c2339be6fce8742744dd97c6c43ec592342d Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Tue, 28 Nov 2023 11:02:43 +0300 Subject: [PATCH] Fix the situation when transport may send data from upper levels BEFORE sending the open_ack --- .../src/unicast/establishment/accept.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/io/zenoh-transport/src/unicast/establishment/accept.rs b/io/zenoh-transport/src/unicast/establishment/accept.rs index 412affd4ea..b44b01af35 100644 --- a/io/zenoh-transport/src/unicast/establishment/accept.rs +++ b/io/zenoh-transport/src/unicast/establishment/accept.rs @@ -628,18 +628,19 @@ pub(crate) async fn accept_link(link: &LinkUnicast, manager: &TransportManager) is_lowlatency: state.ext_lowlatency.is_lowlatency(), }; - let transport = step!( - manager - .init_transport_unicast(config, link.clone(), LinkUnicastDirection::Inbound) - .await - ); - // Send the open_ack on the link step!(link .send(&oack_out.open_ack.into()) .await .map_err(|e| (e, Some(close::reason::GENERIC)))); + // init the transport + let transport = step!( + manager + .init_transport_unicast(config, link.clone(), LinkUnicastDirection::Inbound) + .await + ); + // Sync the RX sequence number let _ = step!(transport .get_inner()