Skip to content
This repository was archived by the owner on May 4, 2018. It is now read-only.

Commit 377bf68

Browse files
committed
windows: count queued bytes even if request completed immediately
The send_queue_size/count needs to maintain its value until right before the callback is called.
1 parent ebafb90 commit 377bf68

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/win/udp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ static int uv__send(uv_udp_send_t* req,
398398
/* Request completed immediately. */
399399
req->queued_bytes = 0;
400400
handle->reqs_pending++;
401+
handle->send_queue_size += req->queued_bytes;
402+
handle->send_queue_count++;
401403
REGISTER_HANDLE_REQ(loop, handle, req);
402404
uv_insert_pending_req(loop, (uv_req_t*)req);
403405
} else if (UV_SUCCEEDED_WITH_IOCP(result == 0)) {

0 commit comments

Comments
 (0)