From 8fbf5bef60568cd4dcd56921c37be64b8234d9bb Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 9 Dec 2020 17:13:34 +0100 Subject: Fix: workarounds for two emscripten bugs in the network stack --- src/network/core/tcp_listen.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/network/core/tcp_listen.h') 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? -- cgit v1.2.3-54-g00ecf