Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index aa2a71af54f8a29b97d0084afb19e901a03a0639..2473949dec583e6e5ae85799f42df8f60dbae790 100644 |
--- a/src/platform-win32.cc |
+++ b/src/platform-win32.cc |
@@ -1849,8 +1849,18 @@ bool Win32Socket::Shutdown() { |
int Win32Socket::Send(const char* data, int len) const { |
if (len <= 0) return 0; |
- int status = send(socket_, data, len, 0); |
- return (status == SOCKET_ERROR) ? 0 : status; |
+ int written = 0; |
+ while (written < len) { |
+ int status = send(socket_, data + written, len - written, 0); |
+ if (status == 0) { |
+ break; |
+ } else if (status > 0) { |
+ written += status; |
+ } else { |
+ return 0; |
+ } |
+ } |
+ return written; |
} |