diff options
author | Fedor Indutny <fedor@indutny.com> | 2016-05-26 03:42:56 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2016-05-26 03:42:56 -0400 |
commit | f3be4240e5da100f7615e6805648ed50485c2ebb (patch) | |
tree | 1ab9b525bdf3f47a53d49602a0383548861906b6 /src | |
parent | e6061e7dbcc1ac16222f2c44c467cf5e7a3f31ad (diff) | |
download | uv_link_t-f3be4240e5da100f7615e6805648ed50485c2ebb.tar.gz |
example: initial
Diffstat (limited to 'src')
-rw-r--r-- | src/uv_link_observer_t.c | 8 | ||||
-rw-r--r-- | src/uv_link_t.c | 9 |
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; } |