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

Commit

Permalink
windows: count queued bytes even if request completed immediately
Browse files Browse the repository at this point in the history
The send_queue_size/count needs to maintain its value until right before
the callback is called.
  • Loading branch information
saghul committed Jul 6, 2014
1 parent ebafb90 commit 377bf68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/win/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ static int uv__send(uv_udp_send_t* req,
/* Request completed immediately. */
req->queued_bytes = 0;
handle->reqs_pending++;
handle->send_queue_size += req->queued_bytes;
handle->send_queue_count++;
REGISTER_HANDLE_REQ(loop, handle, req);
uv_insert_pending_req(loop, (uv_req_t*)req);
} else if (UV_SUCCEEDED_WITH_IOCP(result == 0)) {
Expand Down

0 comments on commit 377bf68

Please sign in to comment.