summaryrefslogtreecommitdiff
path: root/src/network/core/udp.cpp
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/udp.cpp
parentd5b9f7ac37c7d27d1ffe50e55aa73361da64189b (diff)
downloadopenttd-8fbf5bef60568cd4dcd56921c37be64b8234d9bb.tar.xz
Fix: workarounds for two emscripten bugs in the network stack
Diffstat (limited to 'src/network/core/udp.cpp')
-rw-r--r--src/network/core/udp.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index 57352412b..aa6d39cbb 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -129,6 +129,9 @@ void NetworkUDPSocketHandler::ReceivePackets()
/* Did we get the bytes for the base header of the packet? */
if (nbytes <= 0) break; // No data, i.e. no packet
if (nbytes <= 2) continue; // Invalid data; try next packet
+#ifdef __EMSCRIPTEN__
+ client_len = FixAddrLenForEmscripten(client_addr);
+#endif
NetworkAddress address(client_addr, client_len);
p.PrepareToRead();