Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_datagram_size() seems to be off by 2 #1412

Closed
jfro opened this issue Sep 21, 2022 · 6 comments
Closed

max_datagram_size() seems to be off by 2 #1412

jfro opened this issue Sep 21, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@jfro
Copy link
Contributor

jfro commented Sep 21, 2022

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.

@Ralith Ralith added the bug Something isn't working label Sep 22, 2022
@Ralith
Copy link
Collaborator

Ralith commented Sep 22, 2022

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

@Ralith
Copy link
Collaborator

Ralith commented Sep 23, 2022

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

@jfro
Copy link
Contributor Author

jfro commented Sep 23, 2022

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.

@terrarier2111
Copy link
Contributor

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

@Ralith
Copy link
Collaborator

Ralith commented Oct 4, 2022

That was #1413, which was fixed in #1415.

@Ralith
Copy link
Collaborator

Ralith commented Aug 22, 2023

Closing as not reproducible.

@Ralith Ralith closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants