diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qnetworkreplywasmimpl.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.cpp | 5 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.h | 5 |
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; |