Closed dignifiedquire closed 7 months ago
What happens when a poll_send
call isn't able to transmit all packets immediately, i.e. returns less than transmits.len()
? It seems difficult to avoid unpredictably double-translating addresses with this change, which could be harmful if your translation isn't idempotent.
That should be easy enough to handle on our side, we can either reset to the original addrs for those that weren't sent, or detect based on the addr if we have mapped it yet.
The CI failures look unrelated to me: BSD seems to hang and the lint is complaining about unrelated code.
this would be useful for us too (for address mangling as well)
I'd like to at least see a clearly documented contract for whether or not unsent entries may be changed after the call returns. I think it should specifically guarantee that they won't be to avoid unpredictable behavior. It's not clear to me if that guarantee can be respected without defeating the point by requiring storage on the side, though.
Is this copy showing up in profiling at all? It should be straightforward to reuse an allocation for it.
https://github.com/quinn-rs/quinn/pull/1729 will likely render this unnecessary by only accepting a single, trivially rewritten Transmit
at a time.
Closing in favor of #1729
In our implementation (n0-computer/iroh) we currently have to maniuplate the destination addresses based on internal mappings. Currently we need to copy the full
Transmit
slice in order to update these addresses. To avoid this copy, this changes it such that a mutable reference is passed in.