about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/uv_link_observer_t.c8
-rw-r--r--src/uv_link_t.c9
2 files changed, 8 insertions, 9 deletions
diff --git a/src/uv_link_observer_t.c b/src/uv_link_observer_t.c
index cd389f6..3ce0df9 100644
--- a/src/uv_link_observer_t.c
+++ b/src/uv_link_observer_t.c
@@ -81,7 +81,10 @@ static uv_link_methods_t uv_link_observer_methods = {
   .read_stop = uv_link_observer_read_stop,
   .write = uv_link_observer_write,
   .try_write = uv_link_observer_try_write,
-  .shutdown = uv_link_observer_shutdown
+  .shutdown = uv_link_observer_shutdown,
+
+  .alloc_cb_override = uv_link_observer_alloc_cb,
+  .read_cb_override = uv_link_observer_read_cb
 };
 
 
@@ -97,8 +100,7 @@ int uv_link_observer_init(uv_link_observer_t* observer,
 
   observer->target = target;
 
-  err = uv_link_chain(target, &observer->link, uv_link_observer_alloc_cb,
-                      uv_link_observer_read_cb);
+  err = uv_link_chain(target, &observer->link);
   if (err != 0) {
     uv_link_close(&observer->link);
     return err;
diff --git a/src/uv_link_t.c b/src/uv_link_t.c
index 769b269..fc6eabc 100644
--- a/src/uv_link_t.c
+++ b/src/uv_link_t.c
@@ -41,10 +41,7 @@ void uv_link_close(uv_link_t* link) {
 }
 
 
-int uv_link_chain(uv_link_t* from,
-                  uv_link_t* to,
-                  uv_link_alloc_cb alloc_cb,
-                  uv_link_read_cb read_cb) {
+int uv_link_chain(uv_link_t* from, uv_link_t* to) {
   if (from->child != NULL || to->parent != NULL)
     return UV_EINVAL;
 
@@ -53,8 +50,8 @@ int uv_link_chain(uv_link_t* from,
 
   from->saved_alloc_cb = from->alloc_cb;
   from->saved_read_cb = from->read_cb;
-  from->alloc_cb = alloc_cb;
-  from->read_cb = read_cb;
+  from->alloc_cb = to->methods->alloc_cb_override;
+  from->read_cb = to->methods->read_cb_override;
 
   return 0;
 }