summaryrefslogtreecommitdiff
path: root/src/stream_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream_wrap.cc')
-rw-r--r--src/stream_wrap.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc
index 2dea245fd1..60a1754542 100644
--- a/src/stream_wrap.cc
+++ b/src/stream_wrap.cc
@@ -276,10 +276,7 @@ WriteWrap* LibuvStreamWrap::CreateWriteWrap(Local<Object> object) {
int LibuvStreamWrap::DoShutdown(ShutdownWrap* req_wrap_) {
LibuvShutdownWrap* req_wrap = static_cast<LibuvShutdownWrap*>(req_wrap_);
- int err;
- err = uv_shutdown(req_wrap->req(), stream(), AfterUvShutdown);
- req_wrap->Dispatched();
- return err;
+ return req_wrap->Dispatch(uv_shutdown, stream(), AfterUvShutdown);
}
@@ -340,9 +337,14 @@ int LibuvStreamWrap::DoWrite(WriteWrap* req_wrap,
LibuvWriteWrap* w = static_cast<LibuvWriteWrap*>(req_wrap);
int r;
if (send_handle == nullptr) {
- r = uv_write(w->req(), stream(), bufs, count, AfterUvWrite);
+ r = w->Dispatch(uv_write, stream(), bufs, count, AfterUvWrite);
} else {
- r = uv_write2(w->req(), stream(), bufs, count, send_handle, AfterUvWrite);
+ r = w->Dispatch(uv_write2,
+ stream(),
+ bufs,
+ count,
+ send_handle,
+ AfterUvWrite);
}
if (!r) {
@@ -356,8 +358,6 @@ int LibuvStreamWrap::DoWrite(WriteWrap* req_wrap,
}
}
- w->Dispatched();
-
return r;
}