mirror of
https://github.com/libuv/libuv
synced 2025-03-28 21:13:16 +00:00
test: fix test-tcp-shutdown-after-write bug
It was calling uv_read_start before the uv_connect call had completed. Although we want to allow this in the future, right now it's not supported.
This commit is contained in:
parent
23b4e38d20
commit
b5a15f5cdf
@ -70,13 +70,18 @@ static void timer_cb(uv_timer_t* handle, int status) {
|
||||
}
|
||||
|
||||
|
||||
static void connect_cb(uv_connect_t* req, int status) {
|
||||
ASSERT(status == 0);
|
||||
connect_cb_called++;
|
||||
static void read_cb(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
|
||||
}
|
||||
|
||||
|
||||
static void read_cb(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
|
||||
static void connect_cb(uv_connect_t* req, int status) {
|
||||
int r;
|
||||
|
||||
ASSERT(status == 0);
|
||||
connect_cb_called++;
|
||||
|
||||
r = uv_read_start((uv_stream_t*)&conn, alloc_cb, read_cb);
|
||||
ASSERT(r == 0);
|
||||
}
|
||||
|
||||
|
||||
@ -113,9 +118,6 @@ TEST_IMPL(tcp_shutdown_after_write) {
|
||||
r = uv_tcp_connect(&connect_req, &conn, addr, connect_cb);
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_read_start((uv_stream_t*)&conn, alloc_cb, read_cb);
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_run(loop);
|
||||
ASSERT(r == 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user