diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-28 11:29:18 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-28 11:29:18 -0700 |
commit | 9070da684d66719f7b130a6d0360491bfc727ee2 (patch) | |
tree | 432c2beab1c56c97dd2e7c94649e23225611f88e | |
parent | fc15d3d8092bce3319a2b5e210dc97cb7859634a (diff) |
final fixes for websockets test, now passes
-rw-r--r-- | src/library.js | 5 | ||||
-rwxr-xr-x | tests/runner.py | 4 | ||||
-rw-r--r-- | tests/websockets.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index e03af95a..d69068fc 100644 --- a/src/library.js +++ b/src/library.js @@ -6411,6 +6411,11 @@ LibraryManager.library = { return ret; }, + shutdown: function(fd, how) { + Sockets.fds[fd].socket.close(); + Sockets.fds[fd] = null; + }, + // ========================================================================== // emscripten.h // ========================================================================== diff --git a/tests/runner.py b/tests/runner.py index 776ebcb2..806f3839 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8447,7 +8447,7 @@ elif 'browser' in str(sys.argv): ''') self.btest('pre_run_deps.cpp', expected='10', args=['--pre-js', 'pre.js']) - def zzztest_websockets(self): + def test_websockets(self): try: def server_func(): os.system('while true; do (/bin/echo -en "te\x01\xff\x79st\x02" ; sleep 1000) | nc -vvvl 127.0.0.1 8990; done;') # sleep to work around websockify issue 63 @@ -8463,7 +8463,7 @@ elif 'browser' in str(sys.argv): websockify.start() print '[Websockify on process %d]' % websockify.pid - self.btest('websockets.c', expected='fleefl') + self.btest('websockets.c', expected='571') finally: try: diff --git a/tests/websockets.c b/tests/websockets.c index 5988b633..c74b145d 100644 --- a/tests/websockets.c +++ b/tests/websockets.c @@ -60,6 +60,8 @@ void iter(void *arg) { done = 1; + printf("sum: %d\n", sum); + #if EMSCRIPTEN int result = sum; REPORT_RESULT(); |