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

Unified Diff: test/cctest/test-sockets.cc

Issue 40104: Removed function SendAll from Socket (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 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-win32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-sockets.cc
===================================================================
--- test/cctest/test-sockets.cc (revision 1410)
+++ test/cctest/test-sockets.cc (working copy)
@@ -63,6 +63,19 @@
}
+static bool SendAll(Socket* socket, const char* data, int len) {
+ int sent_len = 0;
+ while (sent_len < len) {
+ int status = socket->Send(data, len);
+ if (status <= 0) {
+ return false;
+ }
+ sent_len += status;
+ }
+ return true;
+}
+
+
static void SendAndReceive(char *data, int len) {
bool ok;
@@ -78,7 +91,7 @@
CHECK(ok);
// Send all the data.
- ok = client->SendAll(data, len);
+ ok = SendAll(client, data, len);
CHECK(ok);
// Wait until data is received.
« no previous file with comments | « src/platform-win32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698