From 2173cc63f536a31ccbfd3bc6e07b663de40d3e4b Mon Sep 17 00:00:00 2001 From: "kaie%kuix.de" Date: Fri, 30 Jun 2006 21:22:22 +0000 Subject: [PATCH] Bug 331977, No error dialog is presented if an SSL rehandshake fails r=rrelyea git-svn-id: svn://10.0.0.236/trunk@201378 18797224-902f-48f8-a5cc-f745e15eee43 --- .../security/manager/ssl/src/nsNSSIOLayer.cpp | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/mozilla/security/manager/ssl/src/nsNSSIOLayer.cpp b/mozilla/security/manager/ssl/src/nsNSSIOLayer.cpp index 1cb9c645ab5..f8c59528202 100644 --- a/mozilla/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/mozilla/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -1076,19 +1076,18 @@ nsSSLThread::checkHandshake(PRInt32 bytesTransfered, PRFileDesc* ssl_layer_fd, n PRBool handleHandshakeResultNow; socketInfo->GetHandshakePending(&handleHandshakeResultNow); - if (0 > bytesTransfered && handleHandshakeResultNow) { + if (0 > bytesTransfered) { PRInt32 err = PR_GetError(); - - // Let's see if there was an error set by the SSL libraries that we - // should tell the user about. - if (PR_WOULD_BLOCK_ERROR == err) { - // we are not yet ready to handle the result code from the - // first transfer after the handshake - handleHandshakeResultNow = PR_FALSE; - socketInfo->SetHandshakeInProgress(PR_TRUE); - } - else { - PRBool wantRetry = PR_FALSE; + PRBool wantRetry = PR_FALSE; + + if (handleHandshakeResultNow) { + // Let's see if there was an error set by the SSL libraries that we + // should tell the user about. + if (PR_WOULD_BLOCK_ERROR == err) { + socketInfo->SetHandshakeInProgress(PR_TRUE); + return bytesTransfered; + } + PRBool withInitialCleartext = socketInfo->GetHasCleartextPhase(); // When not using a proxy we'll see a connection reset error. @@ -1104,10 +1103,10 @@ nsSSLThread::checkHandshake(PRInt32 bytesTransfered, PRFileDesc* ssl_layer_fd, n PR_SetError(PR_CONNECT_RESET_ERROR, 0); } } - - if (!wantRetry && (IS_SSL_ERROR(err) || IS_SEC_ERROR(err))) { - nsHandleSSLError(socketInfo, err); - } + } + + if (!wantRetry && (IS_SSL_ERROR(err) || IS_SEC_ERROR(err))) { + nsHandleSSLError(socketInfo, err); } }