From 5234c6c6a8b8ee7cc33dde41c37dd3866c99405b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 7 Feb 2020 15:00:55 +0100 Subject: Account for a reply that is finished before we can connect the signals In a case where a connection is refused, then it is possible for it to fail at the time that the QHttpNetworkReply is being created and therefore after the connections have been made it would have already emitted the signal to indicate it was finished with an error. To account for this, then it checks if there is an error code set on the reply and if there is then it will call the relevant slot right away. Fixes: QTBUG-57799 Change-Id: I4e73e5c82092c09f825343d18db40b47c3cdb9ac Reviewed-by: Timur Pocheptsov --- src/network/access/qhttpnetworkreply.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/network/access/qhttpnetworkreply.cpp') diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index a8b635c45a..7ccac88878 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -158,6 +158,11 @@ QString QHttpNetworkReply::errorString() const return d_func()->errorString; } +QNetworkReply::NetworkError QHttpNetworkReply::errorCode() const +{ + return d_func()->httpErrorCode; +} + QString QHttpNetworkReply::reasonPhrase() const { return d_func()->reasonPhrase; -- cgit v1.2.3