summaryrefslogtreecommitdiffstats
path: root/net/socket/ssl_client_socket_nss.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket/ssl_client_socket_nss.cc')
-rw-r--r--net/socket/ssl_client_socket_nss.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index f75b5f8..92f6c37 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -2101,6 +2101,17 @@ int SSLClientSocketNSS::Core::BufferRecv() {
if (transport_recv_busy_)
return ERR_IO_PENDING;
+ // If NSS is blocked on reading from |nss_bufs_|, because it is empty,
+ // determine how much data NSS wants to read. If NSS was not blocked,
+ // this will return 0.
+ int requested = memio_GetReadRequest(nss_bufs_);
+ if (requested == 0) {
+ // This is not a perfect match of error codes, as no operation is
+ // actually pending. However, returning 0 would be interpreted as a
+ // possible sign of EOF, which is also an inappropriate match.
+ return ERR_IO_PENDING;
+ }
+
char* buf;
int nb = memio_GetReadParams(nss_bufs_, &buf);
int rv;