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

Unified Diff: net/socket/ssl_client_socket_impl.cc

Issue 2736103002: Only pump SSL_read extra times when there is data available synchronously. (Closed)
Patch Set: svaldez comments, SSLClientSocketReadTest Created 3 years, 9 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 | « no previous file | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_impl.cc
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index 5cfb59643cbc9912178cc78f3cecd1cae2a286e8..6033ee2dd0176cc282e33495aff66fadd98dd96c 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -1400,7 +1400,10 @@ int SSLClientSocketImpl::DoPayloadRead(IOBuffer* buf, int buf_len) {
buf_len - total_bytes_read);
if (ssl_ret > 0)
total_bytes_read += ssl_ret;
- } while (total_bytes_read < buf_len && ssl_ret > 0);
+ // Continue processing records as long as there is more data available
+ // synchronously.
+ } while (total_bytes_read < buf_len && ssl_ret > 0 &&
+ transport_adapter_->HasPendingReadData());
// Although only the final SSL_read call may have failed, the failure needs to
// processed immediately, while the information still available in OpenSSL's
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698