diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2018-01-19 01:24:43 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2018-01-19 17:51:04 +0100 |
commit | 20987732434cdd0a11c4b86437a706509907d39c (patch) | |
tree | 69a146aadc2833db663def3f7a172d27afe29704 /test/test-tcp-bind-error.c | |
parent | 1366e7412058be0f1510301454dabbe3004693cc (diff) | |
download | libuv-20987732434cdd0a11c4b86437a706509907d39c.tar.gz libuv-20987732434cdd0a11c4b86437a706509907d39c.zip |
Revert "unix,tcp: avoid marking server sockets connected"
Reverted for breaking Node.js in rather spectacular fashion.
The bug is arguably on the Node.js side. It looks like Node.js starts
reading before the socket is actually connected to something.
Until that is fixed downstream, let's revert the change.
This reverts commit fd049399aa4ed8495928e375466970d98cb42e17.
Fixes: https://github.com/libuv/libuv/issues/1716
Fixes: https://github.com/nodejs/node/issues/18225
PR-URL: https://github.com/libuv/libuv/pull/1717
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'test/test-tcp-bind-error.c')
-rw-r--r-- | test/test-tcp-bind-error.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/test/test-tcp-bind-error.c b/test/test-tcp-bind-error.c index 1456d081..10ed68e1 100644 --- a/test/test-tcp-bind-error.c +++ b/test/test-tcp-bind-error.c @@ -214,45 +214,3 @@ TEST_IMPL(tcp_listen_without_bind) { MAKE_VALGRIND_HAPPY(); return 0; } - - -TEST_IMPL(tcp_bind_writable_flags) { - struct sockaddr_in addr; - uv_tcp_t server; - uv_buf_t buf; - uv_write_t write_req; - uv_shutdown_t shutdown_req; - int r; - - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - r = uv_tcp_init(uv_default_loop(), &server); - ASSERT(r == 0); - r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); - ASSERT(r == 0); - r = uv_listen((uv_stream_t*)&server, 128, NULL); - ASSERT(r == 0); - - ASSERT(0 == uv_is_writable((uv_stream_t*) &server)); - ASSERT(0 == uv_is_readable((uv_stream_t*) &server)); - - buf = uv_buf_init("PING", 4); - r = uv_write(&write_req, (uv_stream_t*) &server, &buf, 1, NULL); - ASSERT(r == UV_EPIPE); - r = uv_shutdown(&shutdown_req, (uv_stream_t*) &server, NULL); -#ifdef _WIN32 - ASSERT(r == UV_EPIPE); -#else - ASSERT(r == UV_ENOTCONN); -#endif - r = uv_read_start((uv_stream_t*) &server, NULL, NULL); - ASSERT(r == UV_ENOTCONN); - - uv_close((uv_handle_t*)&server, close_cb); - - uv_run(uv_default_loop(), UV_RUN_DEFAULT); - - ASSERT(close_cb_called == 1); - - MAKE_VALGRIND_HAPPY(); - return 0; -} |