diff options
-rw-r--r-- | src/library_sockfs.js | 7 | ||||
-rw-r--r-- | tests/sockets/test_sockets_msg.h | 3 | ||||
-rw-r--r-- | tests/test_sockets.py | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/library_sockfs.js b/src/library_sockfs.js index 8e7a9579..8d2fd9d0 100644 --- a/src/library_sockfs.js +++ b/src/library_sockfs.js @@ -146,6 +146,10 @@ mergeInto(LibraryManager.library, { } } +#if SOCKET_DEBUG + Module.print('websocket adding peer: ' + addr + ':' + port); +#endif + var peer = { addr: addr, port: port, @@ -160,6 +164,9 @@ mergeInto(LibraryManager.library, { // us to override the ephemeral port reported to us by remotePort on the // remote end. if (sock.type === {{{ cDefine('SOCK_DGRAM') }}} && typeof sock.sport !== 'undefined') { +#if SOCKET_DEBUG + Module.print('websocket queuing port message (port ' + sock.sport + ')'); +#endif peer.send_queue.push(new Uint8Array([ 255, 255, 255, 255, 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0), diff --git a/tests/sockets/test_sockets_msg.h b/tests/sockets/test_sockets_msg.h index b60b056a..0e68803c 100644 --- a/tests/sockets/test_sockets_msg.h +++ b/tests/sockets/test_sockets_msg.h @@ -17,9 +17,10 @@ int do_msg_read(int sockfd, msg_t *msg, int offset, int length, struct sockaddr return res; } assert(res != 0); - msg->buffer = malloc(msg->length); printf("do_msg_read: allocating %d bytes for message\n", msg->length); + + msg->buffer = malloc(msg->length); } // read the actual message diff --git a/tests/test_sockets.py b/tests/test_sockets.py index d2bc46a2..c19b9d5d 100644 --- a/tests/test_sockets.py +++ b/tests/test_sockets.py @@ -297,7 +297,7 @@ class sockets(BrowserCore): pwd = os.getcwd() os.chdir(self.in_dir('enet')) Popen([PYTHON, path_from_root('emconfigure'), './configure']).communicate() - Popen([PYTHON, path_from_root('emmake'), 'make']).communicate() + Popen([PYTHON, path_from_root('emmake'), 'make', 'CFLAGS=-UHAS_GETHOSTBYADDR_R -UHAS_GETHOSTBYNAME_R']).communicate() enet = [self.in_dir('enet', '.libs', 'libenet.a'), '-I'+path_from_root('tests', 'enet', 'include')] os.chdir(pwd) |