summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2020-07-10 08:52:16 +1000
committerLorn Potter <lorn.potter@gmail.com>2020-07-29 09:09:03 +1000
commit44d4bc6d90442e1f82b8f921165360fecf3bed67 (patch)
treec3f9e6cfc2b59f379e75247d908f8c90a61c64f4 /src
parent762b5f09a61f1f58c0ab7365bf5e826438421c12 (diff)
downloadqtbase-44d4bc6d90442e1f82b8f921165360fecf3bed67.tar.gz
wasm: fix setTransferTimeout
WebAssembly does not need the http feature, but these functions were hidden behind that feature. Fixes: QTBUG-83867 Pick-to: 5.15 Change-Id: I7cd9aa73003f45ccbc2613c67c21e4067d6edddd Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/network/access/qnetworkreplywasmimpl.cpp2
-rw-r--r--src/network/access/qnetworkrequest.cpp5
-rw-r--r--src/network/access/qnetworkrequest.h5
4 files changed, 8 insertions, 6 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 27801621db..b301dcd9b3 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1144,7 +1144,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, redirectPolicy());
}
-#if QT_CONFIG(http)
+#if QT_CONFIG(http) || defined (Q_OS_WASM)
if (!req.transferTimeout())
req.setTransferTimeout(transferTimeout());
#endif
diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp
index c2e66fea5b..1809672401 100644
--- a/src/network/access/qnetworkreplywasmimpl.cpp
+++ b/src/network/access/qnetworkreplywasmimpl.cpp
@@ -268,7 +268,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
attr.onerror = QNetworkReplyWasmImplPrivate::downloadFailed;
attr.onprogress = QNetworkReplyWasmImplPrivate::downloadProgress;
attr.onreadystatechange = QNetworkReplyWasmImplPrivate::stateChange;
- attr.timeoutMSecs = QNetworkRequest::DefaultTransferTimeoutConstant;
+ attr.timeoutMSecs = request.transferTimeout();
attr.userData = reinterpret_cast<void *>(this);
QString dPath = QStringLiteral("/home/web_user/") + request.url().fileName();
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index f8cb3feb69..46c4648cbe 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -905,7 +905,8 @@ void QNetworkRequest::setHttp2Configuration(const QHttp2Configuration &configura
{
d->h2Configuration = configuration;
}
-
+#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+#if QT_CONFIG(http) || defined(Q_CLANG_QDOC) || defined (Q_OS_WASM)
/*!
\since 5.15
@@ -939,7 +940,7 @@ void QNetworkRequest::setTransferTimeout(int timeout)
{
d->transferTimeout = timeout;
}
-#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC) || defined (Q_OS_WASM)
static QByteArray headerName(QNetworkRequest::KnownHeaders header)
{
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index 035b5b378a..e0476d8036 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -180,10 +180,11 @@ public:
#if QT_CONFIG(http) || defined(Q_CLANG_QDOC)
QHttp2Configuration http2Configuration() const;
void setHttp2Configuration(const QHttp2Configuration &configuration);
-
+#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+#if QT_CONFIG(http) || defined(Q_CLANG_QDOC) || defined (Q_OS_WASM)
int transferTimeout() const;
void setTransferTimeout(int timeout = DefaultTransferTimeoutConstant);
-#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC) || defined (Q_OS_WASM)
private:
QSharedDataPointer<QNetworkRequestPrivate> d;
friend class QNetworkRequestPrivate;