File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6687,15 +6687,17 @@ inline ssize_t SSLSocketStream::read(char *ptr, size_t size) {
66876687 auto ret = SSL_read (ssl_, ptr, static_cast <int >(size));
66886688 if (ret < 0 ) {
66896689 auto err = SSL_get_error (ssl_, ret);
6690+ int n = 1000 ;
66906691#ifdef _WIN32
6691- while (err == SSL_ERROR_WANT_READ ||
6692- err == SSL_ERROR_SYSCALL && WSAGetLastError () == WSAETIMEDOUT) {
6692+ while (--n >= 0 && ( err == SSL_ERROR_WANT_READ ||
6693+ err == SSL_ERROR_SYSCALL && WSAGetLastError () == WSAETIMEDOUT)) {
66936694#else
6694- while (err == SSL_ERROR_WANT_READ) {
6695+ while (--n >= 0 && err == SSL_ERROR_WANT_READ) {
66956696#endif
66966697 if (SSL_pending (ssl_) > 0 ) {
66976698 return SSL_read (ssl_, ptr, static_cast <int >(size));
66986699 } else if (is_readable ()) {
6700+ std::this_thread::sleep_for (std::chrono::milliseconds (1 ));
66996701 ret = SSL_read (ssl_, ptr, static_cast <int >(size));
67006702 if (ret >= 0 ) { return ret; }
67016703 err = SSL_get_error (ssl_, ret);
You can’t perform that action at this time.
0 commit comments