Http2: set the reply's error code and string on error

If the error occurs during the call to
QHttpNetworkConnectionPrivate::queueRequest coming from the http thread
delegate then we will not yet have connected to the signal! But the http
thread delegate checks if the error code is not NoError, and handles
those situations. To let that work we must update the replies.

Pick-to: 6.0 5.15
Change-Id: I47188e9439920694aaad1765ab28add1e86ccdff
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2020-12-07 18:23:34 +01:00
parent 0e742c9add
commit b4d7908d5a

View File

@ -1119,6 +1119,8 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
for (int a = 0; a < h2Pairs.count(); ++a) {
// emit error for all replies
QHttpNetworkReply *currentReply = h2Pairs.at(a).second;
currentReply->d_func()->errorString = errorString;
currentReply->d_func()->httpErrorCode = errorCode;
Q_ASSERT(currentReply);
emit currentReply->finishedWithError(errorCode, errorString);
}