summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkreply_p.h
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-02-07 15:00:55 +0100
committerAndy Shaw <andy.shaw@qt.io>2020-02-12 22:48:51 +0100
commit5234c6c6a8b8ee7cc33dde41c37dd3866c99405b (patch)
tree06954296ca7ebfe4665c8dea8cd93a631bf832ff /src/network/access/qhttpnetworkreply_p.h
parenta82f9f1a1d7a9a0bd0ceebac6a2bc765b01877e5 (diff)
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 <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkreply_p.h')
-rw-r--r--src/network/access/qhttpnetworkreply_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index 12cfe359aa..9c03a403e1 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -115,6 +115,8 @@ public:
QString errorString() const;
void setErrorString(const QString &error);
+ QNetworkReply::NetworkError errorCode() const;
+
QString reasonPhrase() const;
qint64 bytesAvailable() const;
@@ -259,6 +261,7 @@ public:
qint64 removedContentLength;
QPointer<QHttpNetworkConnection> connection;
QPointer<QHttpNetworkConnectionChannel> connectionChannel;
+ QNetworkReply::NetworkError httpErrorCode = QNetworkReply::NoError;
bool autoDecompress;