about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2016-06-04 10:33:26 -0400
committerFedor Indutny <fedor@indutny.com>2016-06-04 10:33:26 -0400
commit41a0b873defb04c99d189f8bba9dcaf20ec4a156 (patch)
tree8ed5d01e21f08fb7bfce197a3a2dca224e722118 /src
parentd7e448cd031488ab034b4b75945ffabfde569653 (diff)
downloaduv_link_t-41a0b873defb04c99d189f8bba9dcaf20ec4a156.tar.gz
defaults: stop reading on error
Diffstat (limited to 'src')
-rw-r--r--src/uv_link_t.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/uv_link_t.c b/src/uv_link_t.c
index 64ca70d..f83a8a6 100644
--- a/src/uv_link_t.c
+++ b/src/uv_link_t.c
@@ -20,6 +20,10 @@ static void uv_link_def_read_cb(uv_link_t* link,
                                 const uv_buf_t* buf) {
   if (buf != NULL)
     free(buf->base);
+
+  /* Stop reading on error */
+  if (nread < 0)
+    uv_link_read_stop(link);
 }