Fix: workarounds for two emscripten bugs in the network stack

This commit is contained in:
Patric Stout
2020-12-09 17:13:34 +01:00
committed by Patric Stout
parent d5b9f7ac37
commit 8fbf5bef60
4 changed files with 40 additions and 0 deletions

View File

@@ -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();