Skip to content

Commit cb76999

Browse files
committed
deps: upgrade libuv to 06e0319
1 parent 0742f56 commit cb76999

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

deps/uv/src/unix/ev/ev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,6 @@ void
25542554
ev_unref (EV_P)
25552555
{
25562556
--activecnt;
2557-
if (activecnt < 0) abort();
25582557
}
25592558

25602559
void

deps/uv/src/unix/stream.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,19 @@ static void uv__read(uv_stream_t* stream) {
523523
struct cmsghdr* cmsg;
524524
char cmsg_space[64];
525525
struct ev_loop* ev = stream->loop->ev;
526+
int count;
527+
528+
/* Prevent loop starvation when the data comes in as fast as (or faster than)
529+
* we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
530+
*/
531+
count = 32;
526532

527533
/* XXX: Maybe instead of having UV_READING we just test if
528534
* tcp->read_cb is NULL or not?
529535
*/
530-
while ((stream->read_cb || stream->read2_cb) &&
531-
stream->flags & UV_READING) {
536+
while ((stream->read_cb || stream->read2_cb)
537+
&& (stream->flags & UV_READING)
538+
&& (count-- > 0)) {
532539
assert(stream->alloc_cb);
533540
buf = stream->alloc_cb((uv_handle_t*)stream, 64 * 1024);
534541

deps/uv/src/unix/udp.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,17 @@ static void uv__udp_recvmsg(uv_udp_t* handle) {
208208
ssize_t nread;
209209
uv_buf_t buf;
210210
int flags;
211+
int count;
211212

212213
assert(handle->recv_cb != NULL);
213214
assert(handle->alloc_cb != NULL);
214215

216+
/* Prevent loop starvation when the data comes in as fast as (or faster than)
217+
* we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
218+
*/
219+
count = 32;
220+
215221
do {
216-
/* FIXME: hoist alloc_cb out the loop but for now follow uv__read() */
217222
buf = handle->alloc_cb((uv_handle_t*)handle, 64 * 1024);
218223
assert(buf.len > 0);
219224
assert(buf.base != NULL);
@@ -254,6 +259,7 @@ static void uv__udp_recvmsg(uv_udp_t* handle) {
254259
}
255260
/* recv_cb callback may decide to pause or close the handle */
256261
while (nread != -1
262+
&& count-- > 0
257263
&& handle->fd != -1
258264
&& handle->recv_cb != NULL);
259265
}

deps/uv/src/win/tty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ void uv_process_tty_read_line_req(uv_loop_t* loop, uv_tty_t* handle,
688688
if (!REQ_SUCCESS(req)) {
689689
/* Read was not successful */
690690
if ((handle->flags & UV_HANDLE_READING) &&
691-
!(handle->flags & UV_HANDLE_TTY_RAW)) {
691+
handle->read_line_handle != NULL) {
692692
/* Real error */
693693
handle->flags &= ~UV_HANDLE_READING;
694694
uv__set_sys_error(loop, GET_REQ_ERROR(req));

deps/uv/test/runner.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ int run_test(const char* test, int timeout, int benchmark_output) {
8686
int i;
8787

8888
status = 255;
89+
main_proc = NULL;
8990
process_count = 0;
9091

9192
/* If it's a helper the user asks for, start it directly. */

0 commit comments

Comments
 (0)