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

BBA/HLE: Don't assume connect is successful #12555

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

sepalani
Copy link
Contributor

@sepalani sepalani commented Feb 1, 2024

While writing a hardware test, I found that connect was implemented as always being successful. The previous implementation assumed that the connection succeeded (whereas it hasn't yet). Then, a game might call send/recv which will fail but will be reported as successful as well. So the game will assume the data is properly handled when in reality it wasn't since the socket wasn't properly connected yet. It also means sent data is lost since it was assumed as successful so the game has no way to know it failed.

This PR defers the successful connect packet and depends on #12533 for the time being. Here is a test case (based on the previous hardware test) but with an unreachable IP address hardcoded instead of example's one: net_connect_failure.zip

Ready to be reviewed & merged.

@sepalani sepalani force-pushed the bba-connecting branch 3 times, most recently from 89161ca to 104f15b Compare February 3, 2024 06:48
@sepalani sepalani marked this pull request as ready for review February 22, 2024 18:27
@sepalani
Copy link
Contributor Author

I switched from draft to PR and added a test case. It successfully errors on connect whereas before this PR it was successful on connect but would fail on send instead.

@AdmiralCurtiss
Copy link
Contributor

Rebase, please.

@AdmiralCurtiss AdmiralCurtiss changed the title BBA/HLE: Don't assume connect is successful BBA/HLE: Don't assume connect is successful Mar 12, 2024
@AdmiralCurtiss
Copy link
Contributor

No one seems to want to give this a detailed review and this looks fine and has a hardware test, so I'll just merge it.

@AdmiralCurtiss AdmiralCurtiss merged commit d307335 into dolphin-emu:master Apr 5, 2024
11 checks passed
@sepalani sepalani deleted the bba-connecting branch April 6, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants