stream: support empty uv_try_write on unix
PR-URL: https://github.com/libuv/libuv/pull/558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
764877fd9e
commit
5e761a5f81
@ -1471,7 +1471,7 @@ int uv_try_write(uv_stream_t* stream,
|
|||||||
uv__stream_osx_interrupt_select(stream);
|
uv__stream_osx_interrupt_select(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (written == 0)
|
if (written == 0 && req_size != 0)
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
else
|
else
|
||||||
return written;
|
return written;
|
||||||
|
|||||||
@ -58,6 +58,11 @@ static void connect_cb(uv_connect_t* req, int status) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
|
do {
|
||||||
|
buf = uv_buf_init("", 0);
|
||||||
|
r = uv_try_write((uv_stream_t*) &client, &buf, 1);
|
||||||
|
} while (r != 0);
|
||||||
uv_close((uv_handle_t*) &client, close_cb);
|
uv_close((uv_handle_t*) &client, close_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user