Permalink
Browse files

deps: upgrade libuv to 06e0319

  • Loading branch information...
1 parent 0742f56 commit cb76999bad6f20f3643fd6a052511fdca51f0efa @bnoordhuis bnoordhuis committed Jun 5, 2012
Showing with 18 additions and 5 deletions.
  1. +0 −1 deps/uv/src/unix/ev/ev.c
  2. +9 −2 deps/uv/src/unix/stream.c
  3. +7 −1 deps/uv/src/unix/udp.c
  4. +1 −1 deps/uv/src/win/tty.c
  5. +1 −0 deps/uv/test/runner.c
View
1 deps/uv/src/unix/ev/ev.c
@@ -2554,7 +2554,6 @@ void
ev_unref (EV_P)
{
--activecnt;
- if (activecnt < 0) abort();
}
void
View
11 deps/uv/src/unix/stream.c
@@ -523,12 +523,19 @@ static void uv__read(uv_stream_t* stream) {
struct cmsghdr* cmsg;
char cmsg_space[64];
struct ev_loop* ev = stream->loop->ev;
+ int count;
+
+ /* Prevent loop starvation when the data comes in as fast as (or faster than)
+ * we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
+ */
+ count = 32;
/* XXX: Maybe instead of having UV_READING we just test if
* tcp->read_cb is NULL or not?
*/
- while ((stream->read_cb || stream->read2_cb) &&
- stream->flags & UV_READING) {
+ while ((stream->read_cb || stream->read2_cb)
+ && (stream->flags & UV_READING)
+ && (count-- > 0)) {
assert(stream->alloc_cb);
buf = stream->alloc_cb((uv_handle_t*)stream, 64 * 1024);
View
8 deps/uv/src/unix/udp.c
@@ -208,12 +208,17 @@ static void uv__udp_recvmsg(uv_udp_t* handle) {
ssize_t nread;
uv_buf_t buf;
int flags;
+ int count;
assert(handle->recv_cb != NULL);
assert(handle->alloc_cb != NULL);
+ /* Prevent loop starvation when the data comes in as fast as (or faster than)
+ * we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
+ */
+ count = 32;
+
do {
- /* FIXME: hoist alloc_cb out the loop but for now follow uv__read() */
buf = handle->alloc_cb((uv_handle_t*)handle, 64 * 1024);
assert(buf.len > 0);
assert(buf.base != NULL);
@@ -254,6 +259,7 @@ static void uv__udp_recvmsg(uv_udp_t* handle) {
}
/* recv_cb callback may decide to pause or close the handle */
while (nread != -1
+ && count-- > 0
&& handle->fd != -1
&& handle->recv_cb != NULL);
}
View
2 deps/uv/src/win/tty.c
@@ -688,7 +688,7 @@ void uv_process_tty_read_line_req(uv_loop_t* loop, uv_tty_t* handle,
if (!REQ_SUCCESS(req)) {
/* Read was not successful */
if ((handle->flags & UV_HANDLE_READING) &&
- !(handle->flags & UV_HANDLE_TTY_RAW)) {
+ handle->read_line_handle != NULL) {
/* Real error */
handle->flags &= ~UV_HANDLE_READING;
uv__set_sys_error(loop, GET_REQ_ERROR(req));
View
1 deps/uv/test/runner.c
@@ -86,6 +86,7 @@ int run_test(const char* test, int timeout, int benchmark_output) {
int i;
status = 255;
+ main_proc = NULL;
process_count = 0;
/* If it's a helper the user asks for, start it directly. */

0 comments on commit cb76999

Please sign in to comment.