Skip to content

Commit

Permalink
Fix the situation when transport may send data from upper levels BEFO…
Browse files Browse the repository at this point in the history
…RE sending the open_ack
  • Loading branch information
yellowhatter committed Nov 28, 2023
1 parent bbd12e2 commit b0d3c23
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions io/zenoh-transport/src/unicast/establishment/accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b0d3c23

Please sign in to comment.