Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: src/platform-win32.cc

Issue 10416006: Handle EINTR in socket functions and continue incomplete sends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698