summaryrefslogtreecommitdiff
path: root/deps/uv/src/win/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/win/tcp.c')
-rw-r--r--deps/uv/src/win/tcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/deps/uv/src/win/tcp.c b/deps/uv/src/win/tcp.c
index 8b6f0a5c99..3ce5548c0a 100644
--- a/deps/uv/src/win/tcp.c
+++ b/deps/uv/src/win/tcp.c
@@ -945,6 +945,7 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
uv_req_t* req) {
DWORD bytes, flags, err;
uv_buf_t buf;
+ int count;
assert(handle->type == UV_TCP);
@@ -999,7 +1000,8 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
}
/* Do nonblocking reads until the buffer is empty */
- while (handle->flags & UV_HANDLE_READING) {
+ count = 32;
+ while ((handle->flags & UV_HANDLE_READING) && (count-- > 0)) {
buf = uv_buf_init(NULL, 0);
handle->alloc_cb((uv_handle_t*) handle, 65536, &buf);
if (buf.base == NULL || buf.len == 0) {