Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! dgram: use uv_udp_try_send()
  • Loading branch information
addaleax committed Oct 4, 2019
commit 8c18bbb3049399070a08d1e589c6614aad911df3
3 changes: 2 additions & 1 deletion lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ function doSend(ex, self, ip, list, address, port, callback) {
err = state.handle.send(req, list, list.length, !!callback);

if (err >= 1) {
// Synchronous finish.
// Synchronous finish. The return code is msg_length + 1 so that we can
// distinguish between synchronous success and asynchronous success.
if (callback)
process.nextTick(callback, null, err - 1);
Comment thread
addaleax marked this conversation as resolved.
return;
Expand Down
2 changes: 1 addition & 1 deletion src/udp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void UDPWrap::DoSend(const FunctionCallbackInfo<Value>& args, int family) {
count--;
}
if (count > 0) {
CHECK_LE(sent, bufs_ptr->len);
CHECK_LT(sent, bufs_ptr->len);
bufs_ptr->base += sent;
bufs_ptr->len -= sent;
} else {
Expand Down