diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-09-25 22:16:02 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-05-10 15:15:16 +0300 |
commit | cac8496c2ff592198a7afd114610deccb0e178ab (patch) | |
tree | f71985006d0cb1f2348d37c60d5f617db9622439 /src/udp_wrap.cc | |
parent | 17e289eca8f8398243df5c4006d80f7381fd08bc (diff) |
src: unify ReqWrap libuv calling
This allows easier tracking of whether there are active `ReqWrap`s.
Many thanks for Stephen Belanger for reviewing the original version of
this commit in the Ayo.js project.
Refs: https://github.com/ayojs/ayo/pull/85
PR-URL: https://github.com/nodejs/node/pull/19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/udp_wrap.cc')
-rw-r--r-- | src/udp_wrap.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 414fe07eab6..1d1ded449bd 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -380,15 +380,14 @@ void UDPWrap::DoSend(const FunctionCallbackInfo<Value>& args, int family) { } if (err == 0) { - err = uv_udp_send(req_wrap->req(), - &wrap->handle_, - *bufs, - count, - reinterpret_cast<const sockaddr*>(&addr), - OnSend); + err = req_wrap->Dispatch(uv_udp_send, + &wrap->handle_, + *bufs, + count, + reinterpret_cast<const sockaddr*>(&addr), + OnSend); } - req_wrap->Dispatched(); if (err) delete req_wrap; |