diff options
author | Patric Stout <truebrain@openttd.org> | 2020-12-09 17:13:34 +0100 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2020-12-15 15:46:39 +0100 |
commit | 8fbf5bef60568cd4dcd56921c37be64b8234d9bb (patch) | |
tree | a234d6bea0d739dafe344ab64a2d71742e1eae85 /src/network/core/tcp_listen.h | |
parent | d5b9f7ac37c7d27d1ffe50e55aa73361da64189b (diff) | |
download | openttd-8fbf5bef60568cd4dcd56921c37be64b8234d9bb.tar.xz |
Fix: workarounds for two emscripten bugs in the network stack
Diffstat (limited to 'src/network/core/tcp_listen.h')
-rw-r--r-- | src/network/core/tcp_listen.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index d2982363e..1f073aa73 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -42,6 +42,9 @@ public: socklen_t sin_len = sizeof(sin); SOCKET s = accept(ls, (struct sockaddr*)&sin, &sin_len); if (s == INVALID_SOCKET) return; +#ifdef __EMSCRIPTEN__ + sin_len = FixAddrLenForEmscripten(sin); +#endif SetNonBlocking(s); // XXX error handling? |