QNAM: clean the channel request data on server disconnect

Otherwise, we have unexpected channel close initiated by reply
destructor.

Change-Id: I15ad076ff20546e78787e19155544a2e5f8047a1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
This commit is contained in:
Alex Trotsenko 2015-09-24 14:01:45 +03:00
parent 6f8a19846b
commit 7a8c612847

View File

@ -254,6 +254,10 @@ void QHttpNetworkConnectionChannel::handleUnexpectedEOF()
close();
reply->d_func()->errorString = connection->d_func()->errorDetail(QNetworkReply::RemoteHostClosedError, socket);
emit reply->finishedWithError(QNetworkReply::RemoteHostClosedError, reply->d_func()->errorString);
reply = 0;
if (protocolHandler)
protocolHandler->setReply(0);
request = QHttpNetworkRequest();
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
} else {
reconnectAttempts--;