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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 655813003: Close SSLClientSocketOpenSSL cleanly if the transport was closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index aa45a9d3a830260837568207fbac8c666e25c01a..b44ea4c64f7061e4b1c0829bf1480e8d91c9bd1c 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -1358,6 +1358,12 @@ int SSLClientSocketOpenSSL::DoPayloadRead() {
} else if (*next_result < 0) {
int err = SSL_get_error(ssl_, *next_result);
*next_result = MapOpenSSLError(err, err_tracer);
+
+ // Servers do not reliably send close_notify, so
+ // ERR_CONNECTION_CLOSED cannot be treated as fatal.
Ryan Sleevi 2014/10/17 20:53:00 This comment needs explaining (or my flu meds need
davidben 2014/10/20 17:13:24 Done.
+ if (*next_result == ERR_CONNECTION_CLOSED)
+ *next_result = 0;
+
if (rv > 0 && *next_result == ERR_IO_PENDING) {
// If at least some data was read from SSL_read(), do not treat
// insufficient data as an error to return in the next call to
« 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