diff options
| author | 2023-06-25 14:57:34 -0700 | |
|---|---|---|
| committer | 2023-06-25 15:06:52 -0700 | |
| commit | 4a355699219710d0a9ad620722393b3d9a16d84d (patch) | |
| tree | 69b5d25adffe30e968bdcd47c367e0c1040c4427 /src/core/internal_network | |
| parent | ssl: rename argument to avoid false positive codespell warning (diff) | |
| download | yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.gz yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.xz yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.zip | |
Fixes:
- Add missing virtual destructor on `SSLBackend`.
- On Windows, filter out `POLLWRBAND` (one of the new flags added) when
calling `WSAPoll`, because despite the constant being defined on
Windows, passing it calls `WSAPoll` to yield `EINVAL`.
- Reduce OpenSSL version requirement to satisfy CI; I haven't tested
whether it actually builds (or runs) against 1.1.1, but if not, I'll
figure it out.
- Change an instance of memcpy to memmove, even though the arguments
cannot overlap, to avoid a [strange GCC
error](https://github.com/yuzu-emu/yuzu/pull/10912#issuecomment-1606283351).
Diffstat (limited to 'src/core/internal_network')
| -rw-r--r-- | src/core/internal_network/network.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/internal_network/network.cpp b/src/core/internal_network/network.cpp index 39381e06e..0164d12eb 100644 --- a/src/core/internal_network/network.cpp +++ b/src/core/internal_network/network.cpp | |||
| @@ -97,6 +97,8 @@ bool EnableNonBlock(SOCKET fd, bool enable) { | |||
| 97 | 97 | ||
| 98 | Errno TranslateNativeError(int e) { | 98 | Errno TranslateNativeError(int e) { |
| 99 | switch (e) { | 99 | switch (e) { |
| 100 | case 0: | ||
| 101 | return Errno::SUCCESS; | ||
| 100 | case WSAEBADF: | 102 | case WSAEBADF: |
| 101 | return Errno::BADF; | 103 | return Errno::BADF; |
| 102 | case WSAEINVAL: | 104 | case WSAEINVAL: |
| @@ -421,9 +423,14 @@ short TranslatePollEvents(PollEvents events) { | |||
| 421 | translate(PollEvents::WrBand, POLLWRBAND); | 423 | translate(PollEvents::WrBand, POLLWRBAND); |
| 422 | 424 | ||
| 423 | #ifdef _WIN32 | 425 | #ifdef _WIN32 |
| 424 | if (True(events & PollEvents::Pri)) { | 426 | short allowed_events = POLLRDBAND | POLLRDNORM | POLLWRNORM; |
| 425 | LOG_WARNING(Service, "Winsock doesn't support POLLPRI"); | 427 | // Unlike poll on other OSes, WSAPoll will complain if any other flags are set on input. |
| 426 | } | 428 | if (result & ~allowed_events) { |
| 429 | LOG_DEBUG(Network, | ||
| 430 | "Removing WSAPoll input events 0x{:x} because Windows doesn't support them", | ||
| 431 | result & ~allowed_events); | ||
| 432 | } | ||
| 433 | result &= allowed_events; | ||
| 427 | #endif | 434 | #endif |
| 428 | 435 | ||
| 429 | UNIMPLEMENTED_IF_MSG((u16)events != 0, "Unhandled guest events=0x{:x}", (u16)events); | 436 | UNIMPLEMENTED_IF_MSG((u16)events != 0, "Unhandled guest events=0x{:x}", (u16)events); |