Fix E0728: cannot await inside or_else closure in relay.rs

This commit is contained in:
ospab 2026-05-28 19:39:07 +03:00
parent 4ee2007754
commit 4650947b00
1 changed files with 5 additions and 1 deletions

View File

@ -133,7 +133,11 @@ pub async fn handle_relay_message(
if debug {
let _ = ui_event_tx.send(UiEvent::Log(format!("Relay UDP ASSOCIATE stream_id={stream_id}")));
}
let server_udp = match UdpSocket::bind("[::]:0").await.or_else(|_| UdpSocket::bind("0.0.0.0:0").await) {
let udp_bind_result = match UdpSocket::bind("[::]:0").await {
Ok(s) => Ok(s),
Err(_) => UdpSocket::bind("0.0.0.0:0").await,
};
let server_udp = match udp_bind_result {
Ok(s) => std::sync::Arc::new(s),
Err(e) => {
let _ = ui_event_tx.send(UiEvent::Log(format!("UDP bind failed: {e}")));