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

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: 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') | net/socket/ssl_client_socket_unittest.cc » ('J')
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 93153645d5a89c78a4996655ea1b22db83bed84d..8db5e2b0a2d4df67e86f15914046a39e09cf8b37 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -1447,7 +1447,10 @@ int SSLClientSocketImpl::DoPayloadRead() {
user_read_buf_len_ - total_bytes_read);
if (ssl_ret > 0)
total_bytes_read += ssl_ret;
- } while (total_bytes_read < user_read_buf_len_ && ssl_ret > 0);
+ // Continue processing records as long as there is more data available
svaldez 2017/03/07 22:05:54 Move this comment before the do-while loop.
+ // synchronously.
+ } while (total_bytes_read < user_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') | net/socket/ssl_client_socket_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698