summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/stream.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-07-30 23:32:53 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-07-30 23:33:45 +0200
commit3ff2cbc892ce2d6aa01a986963f8437b8070b085 (patch)
tree84efdd2a7462daad3d2ea79bbeea647ad4f67ce9 /deps/uv/src/unix/stream.c
parent4cc57b4aca65ea86f4e42ddaeadfa796db239719 (diff)
downloadandroid-node-v8-3ff2cbc892ce2d6aa01a986963f8437b8070b085.tar.gz
android-node-v8-3ff2cbc892ce2d6aa01a986963f8437b8070b085.tar.bz2
android-node-v8-3ff2cbc892ce2d6aa01a986963f8437b8070b085.zip
deps: upgrade libuv to joyent/libuv@4bdb7d8
Non-release upgrade so pending patches can land.
Diffstat (limited to 'deps/uv/src/unix/stream.c')
-rw-r--r--deps/uv/src/unix/stream.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c
index 4b449dce9c..6d1144f6bc 100644
--- a/deps/uv/src/unix/stream.c
+++ b/deps/uv/src/unix/stream.c
@@ -977,11 +977,16 @@ static void uv__read(uv_stream_t* stream) {
while ((stream->read_cb || stream->read2_cb)
&& (stream->flags & UV_STREAM_READING)
&& (count-- > 0)) {
- assert(stream->alloc_cb);
+ assert(stream->alloc_cb != NULL);
+
buf = stream->alloc_cb((uv_handle_t*)stream, 64 * 1024);
+ if (buf.len == 0) {
+ /* User indicates it can't or won't handle the read. */
+ uv__stream_read_cb(stream, UV_ENOBUFS, buf, UV_UNKNOWN_HANDLE);
+ return;
+ }
- assert(buf.len > 0);
- assert(buf.base);
+ assert(buf.base != NULL);
assert(uv__stream_fd(stream) >= 0);
if (stream->read_cb) {