فهرست منبع

HPCC-20369 Fix Roxie SSL connection logs assertion after timeout

Persistent SSL connections return zero bytes read when the connection
times out.  We should not have an assertion against this case.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Anthony Fishbeck 6 سال پیش
والد
کامیت
0be6faf8bd
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 2 0
      common/thorhelper/roxiehelper.cpp
  2. 2 0
      system/security/securesocket/securesocket.cpp

+ 2 - 0
common/thorhelper/roxiehelper.cpp

@@ -1466,6 +1466,8 @@ bool CSafeSocket::readBlock(StringBuffer &ret, unsigned timeout, HttpHelper *pHt
         try
         {
             sock->read(&len, sizeof (len), sizeof (len), bytesRead, timeout);
+            if (bytesRead==0) //graceful timeout
+                return false;
         }
         catch (IJSOCK_Exception *E)
         {

+ 2 - 0
system/security/securesocket/securesocket.cpp

@@ -783,6 +783,8 @@ void CSecureSocket::readTimeout(void* buf, size32_t min_size, size32_t max_size,
             int err = SSL_get_error(m_ssl, rc);
             // Ignoring SSL_ERROR_SYSCALL because IE prompting user acceptance of the certificate 
             // causes this error, but is harmless.
+            // Ignoring SSL_ERROR_SYSCALL also seems to ignore the timeout value being exceeded,
+            //    but for persistence at least, treating zero bytes read can be treated as a graceful completion of connection
             if((err != SSL_ERROR_NONE) && (err != SSL_ERROR_SYSCALL))
             {
                 if(m_loglevel >= SSLogMax)