From e80bf655e922e9864f8843b5e7bbb47019a6d95a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 7 Dec 2017 19:30:07 +0100 Subject: configure: verify header presence against sources in addition to the actual library resolution, also resolve the headers belonging to the library, to validate the include path, and possibly ensure that the right version of the library is present. the "include" entries were moved out of the "test" objects, and renamed to "headers". this cleanly permits libraries without compile tests. the headers were not put into the sources, because the variance among the includes is generally orthogonal to the variance among the libraries. note that this - like the library resolution - provides no support for darwin frameworks. consequently, the opengl libraries are excluded from the conversion on darwin. similarly, wasm is excluded (centrally), because emcc is magic and would need advanced wizardry to be dealt with. Change-Id: Ib390c75371efa2badcfec9b74274047ce67c3e5a Reviewed-by: Joerg Bornemann Reviewed-by: Paul Wicking --- src/network/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index 019f8378c7..01ed1249e0 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -39,13 +39,13 @@ "libproxy": { "label": "libproxy", "test": { - "include": [ "proxy.h" ], "main": [ "pxProxyFactory *factory = px_proxy_factory_new();", "px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");", "px_proxy_factory_free(factory);" ] }, + "headers": "proxy.h", "sources": [ "-lproxy" ] -- cgit v1.2.3 From 87b20009cc63d3a51e2eb93cd8492c77157b283b Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 11 Dec 2018 13:29:53 +1000 Subject: wasm: do not revise url of queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think this may have been for some POST method form queries, but obviously was missing something. Task-number: QTBUG-72382 Change-Id: I59016776aeedf4b5599b3b44af70610babb0a61e Reviewed-by: Edward Welbourne Reviewed-by: Morten Johan Sørvig Reviewed-by: Ryan Chu --- src/network/access/qnetworkreplywasmimpl.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/network') diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index 23ca62acd4..e8ca4d4084 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -315,17 +315,9 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() val xhr = val::global("XMLHttpRequest").new_(); std::string verb = q->methodName().toStdString(); - QUrl url; QString extraDataString; - if (request.url().hasQuery()) { //strip query from url - extraDataString = request.url().query(QUrl::FullyEncoded); - QString urlStr = request.url().toString(); - url.setUrl(urlStr.left(urlStr.indexOf("?"))); - } else { - url = request.url(); - } - xhr.call("open", verb, url.toString().toStdString()); + xhr.call("open", verb, request.url().toString().toStdString()); xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback")); xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback")); -- cgit v1.2.3 From 5485a085e6d9af34a2ce0b86abf91b0b693b9d05 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 18:56:22 +0200 Subject: configure: optimize the openssl feature structure don't run the openssl_headers test pointlessly when openssl-linked is selected but its test fails. implementing this cleanly required creating a separate openssl-runtime feature, including 'redirecting' the -openssl option (which is just an alias for -openssl-runtime) to it. simplify the openssl-linked conditions: while "anything but the value that enables it" in the 'disable' field effectively means "don't auto-detect it", it's better to be explicit about that. Change-Id: I6b117cc50711bb64d090fcfdb89ff009c60ed86c Reviewed-by: Timur Pocheptsov Reviewed-by: Joerg Bornemann --- src/network/configure.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index 01ed1249e0..3f1cb7893b 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -195,20 +195,24 @@ }, "openssl": { "label": "OpenSSL", - "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'", - "disable": "input.openssl == 'no' || input.ssl == 'no'", - "autoDetect": "!config.winrt && !config.wasm", - "condition": "!features.securetransport && (features.openssl-linked || libs.openssl_headers)", + "enable": "false", + "condition": "features.openssl-runtime || features.openssl-linked", "output": [ "privateFeature", { "type": "publicQtConfig", "condition": "!features.openssl-linked" }, { "type": "define", "negative": true, "name": "QT_NO_OPENSSL" } ] }, + "openssl-runtime": { + "autoDetect": "!config.winrt && !config.wasm", + "enable": "input.openssl == 'yes' || input.openssl == 'runtime'", + "disable": "input.openssl == 'no' || input.openssl == 'linked' || input.ssl == 'no'", + "condition": "!features.securetransport && libs.openssl_headers" + }, "openssl-linked": { "label": " Qt directly linked to OpenSSL", + "autoDetect": false, "enable": "input.openssl == 'linked'", - "disable": "input.openssl != 'linked'", "condition": "!features.securetransport && libs.openssl", "output": [ "privateFeature", -- cgit v1.2.3 From c07ab93c204c134509032d7c3d50f31ee913c57c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 16:46:56 +0200 Subject: configure: adjust openssl lib names on mingw both the mingw and msvc build have a "lib" prefix on the libraries. this makes the msvc build unconventional, so it needs an extra source. for the mingw build, otoh, this is the expected setup, so the source used for unix will work just fine. this doesn't fix any actual bug, because mingw will apparently resolve -llibfoo to libfoo.a even though only liblibfoo.a and libfoo.lib are documented (on mingw.org). however, this mix of conventions is ugly and should be avoided. Change-Id: I32b1621e4ac15db1f071c08ced738bfdafdcc11b Reviewed-by: Timur Pocheptsov Reviewed-by: Joerg Bornemann --- src/network/configure.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index 3f1cb7893b..4e4426342f 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -77,9 +77,12 @@ }, { "libs": "-llibssl -llibcrypto", - "condition": "config.win32" + "condition": "config.msvc" }, - { "libs": "-lssl -lcrypto", "condition": "!config.win32" } + { + "libs": "-lssl -lcrypto", + "condition": "!config.msvc" + } ] } }, -- cgit v1.2.3 From c15afc16ac0d71f1b61ad6154df3a7994e18cc26 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 16:58:00 +0200 Subject: configure: remove openssl placeholder source there is no particular reason to exclude static builds from the default. misses are cheap now, so it's fine if nothing is found. this affects only the legacy pre-1.1 library names under windows. Change-Id: I998b9f7bfcce42ec990a236bb44372c4d6b3f631 Reviewed-by: Timur Pocheptsov --- src/network/configure.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index 4e4426342f..076a1c24a7 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -66,14 +66,9 @@ "test": "openssl", "sources": [ { "type": "openssl" }, - { - "comment": "placeholder for OPENSSL_{PATH,LIBS{,_{DEBUG,RELEASE}}}", - "libs": "", - "condition": "config.win32 && !features.shared" - }, { "libs": "-lssleay32 -llibeay32", - "condition": "config.win32 && features.shared" + "condition": "config.win32" }, { "libs": "-llibssl -llibcrypto", -- cgit v1.2.3 From 10adbc4f0f2d60bc714b304266865bebcce0f909 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 20:26:46 +0200 Subject: configure: inline corewlan test we have support for objc++ since 591edbb11. Change-Id: I5f430fd7c410913d4532627d18529b077f794035 Reviewed-by: Joerg Bornemann --- src/network/configure.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index 076a1c24a7..e823ed9d2f 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -26,7 +26,11 @@ "corewlan": { "label": "CoreWLan", "export": "", - "test": "corewlan", + "test": { + "lang": "objc++", + "main": "[CWInterface interfaceWithName:@\"en2\"];" + }, + "headers": [ "CoreWLAN/CoreWLAN.h", "CoreWLAN/CWInterface.h" ], "sources": [ "-framework CoreWLAN -framework Foundation" ] -- cgit v1.2.3 From 1387f1910bde3743dc181bac9d92e86fb64691ef Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 13 Dec 2018 20:48:49 +1000 Subject: wasm: emit finished after QNetworkReply abort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I23445f5e0c936b82aa5d65b261d456a563deab9a Fixes: QTBUG-72516 Reviewed-by: Morten Johan Sørvig --- src/network/access/qnetworkreplywasmimpl.cpp | 31 +++++++++++++++++++--------- src/network/access/qnetworkreplywasmimpl_p.h | 4 ++++ 2 files changed, 25 insertions(+), 10 deletions(-) (limited to 'src/network') diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index e8ca4d4084..3bfe927c9f 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -222,11 +222,17 @@ QByteArray QNetworkReplyWasmImpl::methodName() const void QNetworkReplyWasmImpl::close() { + setFinished(true); + emit finished(); + QNetworkReply::close(); } void QNetworkReplyWasmImpl::abort() { + Q_D(const QNetworkReplyWasmImpl); + d->doAbort(); + close(); } @@ -307,24 +313,29 @@ void QNetworkReplyWasmImplPrivate::setReplyAttributes(quintptr data, int statusC handler->q_func()->setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, statusReason); } +void QNetworkReplyWasmImplPrivate::doAbort() const +{ + m_xhr.call("abort"); +} + void QNetworkReplyWasmImplPrivate::doSendRequest() { Q_Q(QNetworkReplyWasmImpl); totalDownloadSize = 0; - val xhr = val::global("XMLHttpRequest").new_(); + m_xhr = val::global("XMLHttpRequest").new_(); std::string verb = q->methodName().toStdString(); QString extraDataString; - xhr.call("open", verb, request.url().toString().toStdString()); + m_xhr.call("open", verb, request.url().toString().toStdString()); - xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback")); - xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback")); - xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback")); - xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback")); + m_xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback")); + m_xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback")); + m_xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback")); + m_xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback")); - xhr.set("data-handler", val(quintptr(reinterpret_cast(this)))); + m_xhr.set("data-handler", val(quintptr(reinterpret_cast(this)))); QByteArray contentType = request.rawHeader("Content-Type"); @@ -343,7 +354,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() } if (contentType.contains("json")) { if (!extraDataString.isEmpty()) { - xhr.set("responseType", val("json")); + m_xhr.set("responseType", val("json")); dataToSend = val(extraDataString.toStdString()); } } @@ -360,9 +371,9 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() } // set request headers for (auto header : request.rawHeaderList()) { - xhr.call("setRequestHeader", header.toStdString(), request.rawHeader(header).toStdString()); + m_xhr.call("setRequestHeader", header.toStdString(), request.rawHeader(header).toStdString()); } - xhr.call("send", dataToSend); + m_xhr.call("send", dataToSend); } void QNetworkReplyWasmImplPrivate::emitReplyError(QNetworkReply::NetworkError errorCode, const QString &errorString) diff --git a/src/network/access/qnetworkreplywasmimpl_p.h b/src/network/access/qnetworkreplywasmimpl_p.h index 69c90de41a..e1e6bf4e24 100644 --- a/src/network/access/qnetworkreplywasmimpl_p.h +++ b/src/network/access/qnetworkreplywasmimpl_p.h @@ -62,6 +62,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -134,6 +135,9 @@ public: QIODevice *outgoingData; QSharedPointer outgoingDataBuffer; + emscripten::val m_xhr = emscripten::val::null(); + void doAbort() const; + static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url); Q_DECLARE_PUBLIC(QNetworkReplyWasmImpl) }; -- cgit v1.2.3 From b6cd5fdc6b7c799a80126659f35801af9a26601a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 17:21:03 +0200 Subject: configure: inline openssl test sources Change-Id: I47c1c43b5db30cf1d59de9c6c20ca83abef2cf8c Reviewed-by: Joerg Bornemann --- src/network/configure.json | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index e823ed9d2f..10c4f87a2e 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -57,7 +57,17 @@ "openssl_headers": { "label": "OpenSSL Headers", "export": "openssl", - "test": "openssl", + "test": { + "tail": [ + "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10000000L", + "# error OpenSSL >= 1.0.0 is required", + "#endif", + "#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)", + "# error OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported", + "#endif" + ] + }, + "headers": [ "openssl/ssl.h", "openssl/opensslv.h" ], "sources": [ { "comment": "placeholder for OPENSSL_PATH", @@ -67,7 +77,10 @@ }, "openssl": { "label": "OpenSSL", - "test": "openssl", + "test": { + "inherit": "openssl_headers", + "main": "SSL_free(SSL_new(0));" + }, "sources": [ { "type": "openssl" }, { @@ -149,7 +162,14 @@ "openssl11": { "label": "OpenSSL 1.1 support", "type": "compile", - "test": "unix/openssl11", + "test": { + "include": "openssl/opensslv.h", + "tail": [ + "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L", + "# error OpenSSL >= 1.1 is required", + "#endif" + ] + }, "use": "openssl" }, "dtls": { -- cgit v1.2.3 From 1606a8aa1c8ab2bce4009ba34a854cd83ddf39e0 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 2 Jan 2019 13:44:13 +0100 Subject: Doc: fix typo in QAbstractSocket::bind documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-72780 Change-Id: I16d89d29f573dba37ed8e1986ed9677117ca6aad Reviewed-by: André Hartmann Reviewed-by: Paul Wicking Reviewed-by: Topi Reiniö --- src/network/socket/qabstractsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 2f93c5fa2b..e86793cb21 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1549,7 +1549,7 @@ void QAbstractSocket::setPauseMode(PauseModes pauseMode) By default, the socket is bound using the DefaultForPlatform BindMode. If a port is not specified, a random port is chosen. - On success, the functions returns \c true and the socket enters + On success, the function returns \c true and the socket enters BoundState; otherwise it returns \c false. */ -- cgit v1.2.3 From 012f7bb622add41ffc79c0d1eb62043c840be7db Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 4 Jan 2019 10:45:59 +0100 Subject: Copy backend configuration while setting dtls config When setting dtls configuration, we should also copy backendConfig, otherwise this setting will be ignored. Change-Id: I4df53e8e6d8c2bd0eb7dddb9928b7883c401d60a Reviewed-by: Timur Pocheptsov --- src/network/ssl/qdtls.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/network') diff --git a/src/network/ssl/qdtls.cpp b/src/network/ssl/qdtls.cpp index bbb22aa527..3185bfa124 100644 --- a/src/network/ssl/qdtls.cpp +++ b/src/network/ssl/qdtls.cpp @@ -370,6 +370,7 @@ void QDtlsBasePrivate::setConfiguration(const QSslConfiguration &configuration) dtlsConfiguration.nextProtocolNegotiationStatus = configuration.nextProtocolNegotiationStatus(); dtlsConfiguration.dtlsCookieEnabled = configuration.dtlsCookieVerificationEnabled(); dtlsConfiguration.allowRootCertOnDemandLoading = configuration.d->allowRootCertOnDemandLoading; + dtlsConfiguration.backendConfig = configuration.backendConfiguration(); clearDtlsError(); } -- cgit v1.2.3