Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index 9e377a1977700840306f9f631e51d740091ff79b..aa2a71af54f8a29b97d0084afb19e901a03a0639 100644 |
--- a/src/platform-win32.cc |
+++ b/src/platform-win32.cc |
@@ -1848,14 +1848,16 @@ 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; |
+ return (status == SOCKET_ERROR) ? 0 : status; |
} |
int Win32Socket::Receive(char* data, int len) const { |
+ if (len <= 0) return 0; |
int status = recv(socket_, data, len, 0); |
- return status; |
+ return (status == SOCKET_ERROR) ? 0 : status; |
} |