diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/uv_link_t.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/include/uv_link_t.h b/include/uv_link_t.h index 2adaac3..25c229a 100644 --- a/include/uv_link_t.h +++ b/include/uv_link_t.h @@ -75,6 +75,20 @@ UV_EXTERN void uv_link_propagate_read_cb(uv_link_t* link, ssize_t nread, const uv_buf_t* buf); +static int uv_link_propagate_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, void* arg) { + return link->methods->write(link, source, bufs, nbufs, send_handle, cb, arg); +} + +static int uv_link_propagate_shutdown(uv_link_t* link, + uv_link_t* source, + uv_link_shutdown_cb cb, + void* arg) { + return link->methods->shutdown(link, source, cb, arg); +} + /* Use this to invoke methods of `link` */ static int uv_link_read_start(uv_link_t* link) { @@ -85,28 +99,21 @@ static int uv_link_read_stop(uv_link_t* link) { return link->methods->read_stop(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, - void* arg) { - return link->methods->write(link, source, bufs, nbufs, send_handle, cb, arg); +static int uv_link_write(uv_link_t* link, const uv_buf_t bufs[], + unsigned int nbufs, uv_stream_t* send_handle, + uv_link_write_cb cb, void* arg) { + return uv_link_propagate_write(link, link, bufs, nbufs, send_handle, cb, arg); } - static int uv_link_try_write(uv_link_t* link, const uv_buf_t bufs[], unsigned int nbufs) { return link->methods->try_write(link, bufs, nbufs); } -static int uv_link_shutdown(uv_link_t* link, - uv_link_t* source, - uv_link_shutdown_cb cb, +static int uv_link_shutdown(uv_link_t* link, uv_link_shutdown_cb cb, void* arg) { - return link->methods->shutdown(link, source, cb, arg); + return uv_link_propagate_shutdown(link, link, cb, arg); } /* Link Source */ |