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

Reduce 3DS MTU #14

Merged
merged 10 commits into from
Dec 22, 2023
Merged

Reduce 3DS MTU #14

merged 10 commits into from
Dec 22, 2023

Conversation

zoeyjodon
Copy link

include/enet/protocol.h Show resolved Hide resolved
unix.c Outdated
@@ -469,7 +469,11 @@ enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
{
case ENET_SOCKOPT_ERROR:
len = sizeof (int);
#ifndef __3DS__ //getsockopt is unreliable on 3DS
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, value, & len);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you seeing this codepath get reached during your testing? I don't see anything that calls it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen it reached, I just added in this fix for completeness once I noticed it. Removing it wouldn't cause any issues if you'd prefer keeping the original behavior.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly do you mean when you say "getsockopt() is unreliable"? Are you talking about SO_ERROR specifically or just any getsockopt() call may fail randomly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically SO_ERROR, at least that's the only call that I've seen fail so far. Here's the related libctru issue if you're interested: devkitPro/libctru#412

Copy link
Owner

@cgutman cgutman Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that will probably cause issues with moonlight-common-c, since we use SO_ERROR for non-blocking connects there too. I don't think ENet uses SO_ERROR, so can you remove this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh it definitely caused issues with moonlight-common-c, it was how I first learned about this bug. Good to know this isn't a problem in enet though. Reverted!

@cgutman cgutman merged commit 89a7ebd into cgutman:moonlight Dec 22, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants