summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_listen.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-09 17:13:34 +0100
committerPatric Stout <github@truebrain.nl>2020-12-15 15:46:39 +0100
commit8fbf5bef60568cd4dcd56921c37be64b8234d9bb (patch)
treea234d6bea0d739dafe344ab64a2d71742e1eae85 /src/network/core/tcp_listen.h
parentd5b9f7ac37c7d27d1ffe50e55aa73361da64189b (diff)
downloadopenttd-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.h3
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?