Skip to content

Commit 35af23e

Browse files
authored
fix(iroh): Return error if disco send via relay fails (#3130)
## Description The signature of this function expects an error if the send fails, but the relay part did not do this. The impact of this is that you might silently drop a packet, which makes debugging a bit harder. Returning an error should propagate this correctly and the failures will be noticed and logged. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
1 parent e756710 commit 35af23e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

iroh/src/magicsock.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,9 @@ impl MagicSock {
12141214
self.try_send_disco_message_udp(addr, dst_key, &msg)?;
12151215
}
12161216
SendAddr::Relay(ref url) => {
1217-
self.send_disco_message_relay(url, dst_key, msg);
1217+
if !self.send_disco_message_relay(url, dst_key, msg) {
1218+
return Err(io::Error::new(io::ErrorKind::Other, "Relay channel full"));
1219+
}
12181220
}
12191221
}
12201222
Ok(())

0 commit comments

Comments
 (0)