diff options
author | Matt Kwong <matt-kwong@users.noreply.github.com> | 2017-07-10 10:27:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-10 10:27:23 -0700 |
commit | 33f54afb33ddd4b72be02d6f120fdb46c5a48738 (patch) | |
tree | 3f3f65b8b0ffd4407704e6b00f93bb5656a605c8 /src/core | |
parent | d33ca7026787df26930317492adf767295ad6bec (diff) | |
parent | ce91f4ad17af66ceef21b8f3fbc54dd45f352204 (diff) |
Merge pull request #11051 from jboeuf/fix_issue_11011
Attempt to fix #11011.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/tsi/ssl_transport_security.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index 37d4f038b7..1fd65928f9 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -411,15 +411,11 @@ static tsi_result do_ssl_read(SSL *ssl, unsigned char *unprotected_bytes, GPR_ASSERT(*unprotected_bytes_size <= INT_MAX); read_from_ssl = SSL_read(ssl, unprotected_bytes, (int)*unprotected_bytes_size); - if (read_from_ssl == 0) { - gpr_log(GPR_ERROR, "SSL_read returned 0 unexpectedly."); - return TSI_INTERNAL_ERROR; - } - if (read_from_ssl < 0) { + if (read_from_ssl <= 0) { read_from_ssl = SSL_get_error(ssl, read_from_ssl); switch (read_from_ssl) { - case SSL_ERROR_WANT_READ: - /* We need more data to finish the frame. */ + case SSL_ERROR_ZERO_RETURN: /* Received a close_notify alert. */ + case SSL_ERROR_WANT_READ: /* We need more data to finish the frame. */ *unprotected_bytes_size = 0; return TSI_OK; case SSL_ERROR_WANT_WRITE: |