quinn icon indicating copy to clipboard operation
quinn copied to clipboard

max_datagram_size() seems to be off by 2

Open jfro opened this issue 3 years ago • 1 comments

Not sure if this should just be documented or if there should be a fix to the calculation. If I try to send a packet via send_datagram of data at the size returned by max_datagram_size() I'll get a Toolarge error. I've had to reduce it by 2 to get it to pass the check & send the datagram. I'm calling max_datagram_size() at time of data generation & immediate send_datagram() call so it should be current.

jfro avatar Sep 21 '22 20:09 jfro

Thanks for the report! We should really have a unit test for this.

Ralith avatar Sep 22 '22 03:09 Ralith

I'm not able to reproduce this on 0.8 or main. Can you provide a repro?

Ralith avatar Sep 23 '22 17:09 Ralith

I'll try, but my first attempt at a repro for the assertion bug didn't yield the same problem the original code producing this issue is, haven't found what the difference between the 2 is so far.

jfro avatar Sep 23 '22 18:09 jfro

I had a similar issue where when i sent a packet with a size of max_datagram_size it wouldn't reach its destination, but when subtracting 1 or more from it, it worked

terrarier2111 avatar Oct 04 '22 19:10 terrarier2111

That was https://github.com/quinn-rs/quinn/issues/1413, which was fixed in https://github.com/quinn-rs/quinn/pull/1415.

Ralith avatar Oct 04 '22 20:10 Ralith

Closing as not reproducible.

Ralith avatar Aug 22 '23 02:08 Ralith