Skip to content

Commit

Permalink
Merge branch 'jb53591' into 'mer-5.6'
Browse files Browse the repository at this point in the history
Error gracefully when server closes TLS connection before handshake completes

See merge request mer-core/qtbase!79
  • Loading branch information
llewelld committed Mar 26, 2021
2 parents 02f71e8 + 5247c50 commit d69b282
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/network/access/qhttpnetworkconnectionchannel.cpp
Expand Up @@ -860,7 +860,9 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
} else if (state != QHttpNetworkConnectionChannel::IdleState && state != QHttpNetworkConnectionChannel::ReadingState) {
// Try to reconnect/resend before sending an error.
// While "Reading" the _q_disconnected() will handle this.
if (reconnectAttempts-- > 0) {
// If the protocolHandler hasn't been set up on a TLS connection by this point, it's because
// the connection was closed before the handshake completed and we shouldn't retry.
if (reconnectAttempts-- > 0 && (!ssl || protocolHandler)) {
resendCurrentRequest();
return;
} else {
Expand Down

0 comments on commit d69b282

Please sign in to comment.