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. |