-
-
Save piscisaureus/3f5b4b1c654ebb21ce55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/win/tcp.c b/src/win/tcp.c | |
index ebd8353..10428b5 100644 | |
--- a/src/win/tcp.c | |
+++ b/src/win/tcp.c | |
@@ -659,7 +659,12 @@ int uv_tcp_write(uv_loop_t* loop, uv_write_t* req, uv_tcp_t* handle, | |
req->queued_bytes = 0; | |
handle->reqs_pending++; | |
handle->write_reqs_pending++; | |
- uv_insert_pending_req(loop, (uv_req_t*) req); | |
+ | |
+ if (handle->write_reqs_pending == 1) { | |
+ uv_insert_pending_req(loop, (uv_req_t*) req); | |
+ } else { | |
+ POST_COMPLETION_FOR_REQ(loop, (uv_req_t*) req); | |
+ } | |
} else if (UV_SUCCEEDED_WITH_IOCP(result == 0)) { | |
/* Request queued by the kernel. */ | |
req->queued_bytes = uv_count_bufs(bufs, bufcnt); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment