| Index: net/socket/ssl_client_socket_nss.cc
|
| diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
|
| index e827f398db65eb56a946e5c1ed286f455ccccb12..e1a654577e5c5ecb31ae55685bdf34b52fbfda33 100644
|
| --- a/net/socket/ssl_client_socket_nss.cc
|
| +++ b/net/socket/ssl_client_socket_nss.cc
|
| @@ -1734,15 +1734,26 @@ void SSLClientSocketNSS::UncorkAfterTimeout() {
|
| } while (nsent > 0);
|
| }
|
|
|
| -// Do network I/O between the given buffer and the given socket.
|
| -// Return true if some I/O performed, false otherwise (error or ERR_IO_PENDING)
|
| +// Do as much as possible network I/O between the buffer and the
|
| +// transport socket. Return true if some I/O performed, false
|
| +// otherwise (error or ERR_IO_PENDING).
|
| bool SSLClientSocketNSS::DoTransportIO() {
|
| EnterFunction("");
|
| bool network_moved = false;
|
| if (nss_bufs_ != NULL) {
|
| - int nsent = BufferSend();
|
| - int nreceived = BufferRecv();
|
| - network_moved = (nsent > 0 || nreceived >= 0);
|
| + int rv;
|
| + // Read and write as much data as we can. Loops are neccessary
|
| + // because Read() and Write() may return synchronously.
|
| + do {
|
| + rv = BufferSend();
|
| + if (rv > 0)
|
| + network_moved = true;
|
| + } while (rv > 0);
|
| + do {
|
| + rv = BufferRecv();
|
| + if (rv >= 0)
|
| + network_moved = true;
|
| + } while (rv > 0);
|
| }
|
| LeaveFunction(network_moved);
|
| return network_moved;
|
|
|