about summary refs log tree commit diff stats
path: root/include/uv_link_t.h
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2016-05-26 18:10:04 -0400
committerFedor Indutny <fedor@indutny.com>2016-05-26 18:10:04 -0400
commit48828a62ee235d32c8e53131a55729dea41543ee (patch)
tree4ca3747bd60c1e82ad51055bac935fc38676b267 /include/uv_link_t.h
parentb0a811cf3b097753254170dc6fd08e34f8c2b70d (diff)
downloaduv_link_t-48828a62ee235d32c8e53131a55729dea41543ee.tar.gz
uv_link_t: pass source to write/shutdown
Diffstat (limited to 'include/uv_link_t.h')
-rw-r--r--include/uv_link_t.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/uv_link_t.h b/include/uv_link_t.h
index a964211..63e2410 100644
--- a/include/uv_link_t.h
+++ b/include/uv_link_t.h
@@ -14,14 +14,15 @@ typedef void (*uv_link_alloc_cb)(uv_link_t* link,
 typedef void (*uv_link_read_cb)(uv_link_t* link,
                                 ssize_t nread,
                                 const uv_buf_t* buf);
-typedef void (*uv_link_write_cb)(uv_link_t* link, int status);
-typedef void (*uv_link_shutdown_cb)(uv_link_t* link, int status);
+typedef void (*uv_link_write_cb)(uv_link_t* source, int status);
+typedef void (*uv_link_shutdown_cb)(uv_link_t* source, int status);
 
 struct uv_link_methods_s {
   int (*read_start)(uv_link_t* link);
   int (*read_stop)(uv_link_t* link);
 
   int (*write)(uv_link_t* link,
+               uv_link_t* source,
                const uv_buf_t bufs[],
                unsigned int nbufs,
                uv_stream_t* send_handle,
@@ -30,7 +31,7 @@ struct uv_link_methods_s {
                    const uv_buf_t bufs[],
                    unsigned int nbufs);
 
-  int (*shutdown)(uv_link_t* link, uv_link_shutdown_cb cb);
+  int (*shutdown)(uv_link_t* link, uv_link_t* source, uv_link_shutdown_cb cb);
 
   /* Overriding callbacks */
   uv_link_alloc_cb alloc_cb_override;
@@ -81,11 +82,12 @@ static int uv_link_read_stop(uv_link_t* link) {
 }
 
 static int uv_link_write(uv_link_t* link,
+                         uv_link_t* source,
                          const uv_buf_t bufs[],
                          unsigned int nbufs,
                          uv_stream_t* send_handle,
                          uv_link_write_cb cb) {
-  return link->methods->write(link, bufs, nbufs, send_handle, cb);
+  return link->methods->write(link, source, bufs, nbufs, send_handle, cb);
 }
 
 
@@ -95,8 +97,10 @@ static int uv_link_try_write(uv_link_t* link,
   return link->methods->try_write(link, bufs, nbufs);
 }
 
-static int uv_link_shutdown(uv_link_t* link, uv_link_shutdown_cb cb) {
-  return link->methods->shutdown(link, cb);
+static int uv_link_shutdown(uv_link_t* link,
+                            uv_link_t* source,
+                            uv_link_shutdown_cb cb) {
+  return link->methods->shutdown(link, source, cb);
 }
 
 /* Link Source */