summaryrefslogtreecommitdiffstats
path: root/src/network/ssl
Commit message (Collapse)AuthorAgeFilesLines
* QSslConfiguration: add documentation for HTTP/2 alpn variableMårten Nordheim2024-04-171-0/+6
| | | | | | | | | It was missing for a long time Pick-to: 6.7 6.5 Change-Id: I209838a3c7b45c8c2e8da21efea306fafddea891 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mate Barany <mate.barany@qt.io>
* Network: Add Q_GADGET to types exposed in signals and slotsUlf Hermann2024-04-171-0/+1
| | | | | | | | | | | In order to build a complete graph of metaobjects via properties and methods we need to know about all argument and return types as metaobjecs. Such a graph is desirable for reasoning about the consistency of the type system. Task-number: QTBUG-101143 Change-Id: Ic4e2f58a4275df06178437c6d45270f3f2aa5ce6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Clarify the priority in selecting TLS backendsTimur Pocheptsov2024-03-221-1/+6
| | | | | | | | | | | In case a custom TLS plugin is provided, the order can be unclear (next after OpenSSL is either Schannel on Windows, or Secure Transport on Darwin, then a custom plugin, if any, and the last one is 'cert-only'). Pick-to: 6.7 6.6 6.5 6.2 Fixes: QTBUG-123092 Change-Id: I02bcc1fa5448f64846d561a72b2522af3286c66c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port to QDirListingAhmad Samir2024-03-031-4/+7
| | | | | | | | | | | Use QDirListing in the Bootstrap build instead of QDirIterator. Drive-by changes: - more const variables - use emplace_back() instead of append() where appropriate Change-Id: Ie1f0d03856e557c4bfabfff38a87edc7da86d091 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Network: includemocsMårten Nordheim2024-02-231-0/+2
| | | | | Change-Id: I81defa535dcbe81ddcf9be6ff2258cde909861a3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSsl: QMetaObject is defined in qobjectdefs.hMarc Mutz2024-01-231-1/+1
| | | | | | | | | | | | | | | | | ... not in qmetaobject.h. Don't include more than we need. Found in API-Review. Amends b856790d67ad25f5cd8e374cb299a129acbea2ff. [ChangeLog][QtNetwork] The enums in namespace QSsl are now Q_ENUMs. Pick-to: 6.7 Change-Id: I67ec107ce5ab266cfad8a628e7ba3496d2484766 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix accidental implicit QBA->QString conversionMårten Nordheim2024-01-181-4/+3
| | | | | | | | | | And make sure it cannot happen again by adding the QT_NO_CAST_FROM_ASCII define to the Network module. Amends 5346404da64ac87d161f510d9fee71899d7c70ba Change-Id: Ib10d7822c514caaf40b6b36ee71947c034daf338 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Fix missing certs directory in VxWorksMarcin Zdunek2024-01-161-1/+14
| | | | | | | | | | tst_qsslsocket checks for system CA certificates, which VxWorks doesn't have out of the box, which causes a lot of testcases to fail. As VxWorks doesn't provide default directory structure, directory with ssl certs is provided by setting a variable. Task-number: QTBUG-115777 Change-Id: I5c93933ee5fbcafd6ffd76b574d8793fe75dbdbc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove the use of Q_NETWORK_PRIVATE_EXPORTAlexey Edelev2023-12-222-7/+7
| | | | | | | Task-number: QTBUG-117983 Change-Id: I2339dc96b49aba38169ad3e84f48c9d3c97d6117 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSslConfiguration: remove exampleTimur Pocheptsov2023-12-051-4/+1
| | | | | | | | | | | | It uses the ciphersuite name which smart tools one day will mark as weak (i.e. https://ciphersuite.info/cs/TLS_DHE_DSS_WITH_AES_256_CBC_SHA/ in our example), names in the example are not in the standard notation, + it is and always was OpenSSL-specific example. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-119464 Change-Id: Ic6f095ff2c861582de756bf220e2e74106b88e83 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use SSL_CTX_set_dh_auto if DHparam is emptyAndré Klitzing2023-10-251-0/+3
| | | | | | | | | | [ChangeLog][QtNetwork][QSslDiffieHellmanParameters] An empty Diffie-Hellmann parameter enables auto selection of openssl backend. Fixes: QTBUG-117666 Change-Id: Ic2e0529d48542752ca801bcb4d609988e5ddff25 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Don't mention setDefaultCiphers() (removed in Qt 6.0)Kai Köhne2023-09-281-2/+1
| | | | | | Pick-to: 6.5 6.6 Change-Id: I775da7679bf4ff398a22334103c3116befec7da9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add Q_ENUM macros for registering QSsl/QSslSocket in Meta-systemTatiana Borisova2023-09-212-0/+15
| | | | | | | | | - Macros provide possibility to use enums in QML via QtNetwork QML module Task-number: QTBUG-115056 Change-Id: I1ed96a7eb4b12681d16137528307fec6db5b016c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qsslcertificate: use _ba literal moreAnton Kudryavtsev2023-09-071-11/+10
| | | | | | | to reduce allocations Change-Id: I10a449887b79e40fb4e501634f64b9c86cc8f111 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qsslcertificate: use QStringView moreAnton Kudryavtsev2023-09-071-4/+6
| | | | | | | to avoid needless allocations Change-Id: I54d159cbaa0854355286c942a6971e45c4494a14 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qsslcertificate: use QAnyStringView moreAnton Kudryavtsev2023-09-071-1/+1
| | | | | | | to avoid needless allocations Change-Id: I03494d7075e2f333cbd3974797d9ea97f2c915fd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qsslcertificate: avoid implicit detachAnton Kudryavtsev2023-09-071-7/+7
| | | | | | | by using const methods Change-Id: I62bf869ed1fd4109c855caafa88b8f29a6e5cc05 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSslServer: include mocMårten Nordheim2023-07-071-0/+2
| | | | | | Pick-to: 6.6 6.5 Change-Id: I7849a47b50930640f1937ba34976d2465390daf9 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtNetwork: code tidies: use the 4-arg connect overloadGiuseppe D'Angelo2023-07-051-1/+1
| | | | | | | | | | The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Amends dae24df07fb3db37939e9ece4cf94f223a125f16 Change-Id: Iec1c2cb266fcaca1a1c407a6158cc8bbb282756b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* SSL: upgrade the default DH parametersGiuseppe D'Angelo2023-06-272-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have been using as default DH parameters the 1024-bit MODP group. This is now considered insecure, and applications should use the 2048-bit at a minimum [1]. This commit therefore replaces the parameters with the 2048-bit MODP group from [2]. To double check the data, use openssl asn1parse to verify that the prime matches. For instance: 1) put the encoded string in a `encoded.txt` file (c&p from the source, removing the double quotes) 2) put the hexadecimal value of the 2048-bit group in a `reference.txt` file (c&p from [2]) 3) compare the output of openssl asn1parse with the reference. For instance like this: $ diff <(openssl asn1parse < encoded.txt | grep -m 1 INTEGER | perl -pe 's/.*://; s/\n//') <(perl -0777 -pe 's/\s//g' reference.txt) && echo OK OK [1] https://datatracker.ietf.org/doc/html/rfc8247#section-2.4 [2] https://datatracker.ietf.org/doc/html/rfc3526#section-3 [ChangeLog][QtNetwork][QSslDiffieHellmanParameters] The default Diffie-Hellman parameters are now using the 2048-bit MODP group from RFC 3526. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I47133cd78ba0e954b8f93a3da09fa2c760c9f7a8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QtNetwork: code tidies: use the 4-arg connect overloadGiuseppe D'Angelo2023-06-261-2/+3
| | | | | | | | The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I43dabe3d25ffc2b711aa50dec525d72a8810861c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Schannel: Add support for proper listing of ciphersTobias Koenig2023-06-163-14/+22
| | | | | | | | | | | | | | Reworked the code to list supported ciphers for Schannel backend to provide the proper cipher names and cipher properties. Note: restricting the used ciphers for a TLS connection is only supported for TLS 1.2 yet! [ChangeLog][QtNetwork][QSslConfiguration] Add support for listing supported ciphers with Schannel backend. Change-Id: Idfc17335ec489315387a3e84b7a76a263be22378 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Ssl: Copy the on-demand cert loading bool from default configMårten Nordheim2023-05-291-0/+5
| | | | | | | | | | | | | | | | | | Otherwise individual sockets will still load system certificates when a chain doesn't match against the configured CA certificates. That's not intended behavior, since specifically setting the CA certificates means you don't want the system certificates to be used. Follow-up to/amends ada2c573c1a25f8d96577734968fe317ddfa292a This is potentially a breaking change because now, if you ever add a CA to the default config, it will disable loading system certificates on demand for all sockets. And the only way to re-enable it is to create a null-QSslConfiguration and set it as the new default. Pick-to: 6.5 6.2 5.15 Change-Id: Ic3b2ab125c0cdd58ad654af1cb36173960ce2d1e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslCertificate: Add property names to debug operator<<Axel Spoerl2023-04-041-8/+8
| | | | | | | | | | | | When qDebugging a QSslCertificate, its properties are printed without property names. That makes it difficult to identify which output string correlates to which data element. This patch adds the property name to each output field. Pick-to: 6.5 Change-Id: Icdc54520e048f5fa03e8d9ed0ab2a42371e5a00d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QPasswordDigestor: add OpenSSL 3.0 support to deriveKeyPbkdf2Jan Grulich2023-02-091-2/+96
| | | | | | | | | | | Use OpenSSL 3.0 in deriveKeyPbkdf2() if it's available. This currently produces same results, but in the future we will have possibilities to force some additional compliancy, for example we can enable SP800-132 compliance checks, which are not enabled currently because it would differ from the original implementation. Change-Id: Ia7a7cc91ea3f20c9d76e39309daa7c97cd7ad5c6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove redundant qsharedpointer.h #includesAhmad Samir2023-01-313-3/+2
| | | | | | | In some cases added #include <QtCore/qshareddata.h>. Change-Id: Idc84c4ad6b0bd58e1a67af335dfcff67fdf80b2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: Disambiguate static variablesFriedemann Kleint2023-01-311-4/+4
| | | | | | | | | They causes clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ifd0539c3b56dc395a860de927736f60ad766224a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-214-4/+4
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix duplicated words in documentationMårten Nordheim2022-10-191-1/+1
| | | | | | | | | | | Only did instances where two-and-two words are duplicated, easy to see when wrong. Task-number: QTBUG-107777 Pick-to: 6.4 Change-Id: I11593728acc386e7ef9aba9b39a0a4d9c60a532f Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSslServer[docs]: fix grammarMårten Nordheim2022-10-191-1/+1
| | | | | | | | | s/a/an Fixes: QTBUG-107777 Pick-to: 6.4 Change-Id: I11159202304fc5f892ee41552d110f3a838470f9 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
* Long live Q_UNREACHABLE_RETURN()!Marc Mutz2022-10-152-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of Q_UNREACHABLE() with a return statement. ATM, the return statement is unconditionally included. If we notice that some compilers warn about return after __builtin_unreachable(), then we can map Q_UNREACHABLE_RETURN(...) to Q_UNREACHABLE() without having to touch all the code that uses explicit Q_UNREACHABLE() + return. The fact that Boost has BOOST_UNREACHABLE_RETURN() indicates that there are compilers that complain about a lack of return after Q_UNREACHABLE (we know that MSVC, ICC, and GHS are among them), as well as compilers that complained about a return being present (Coverity). Take this opportunity to properly adapt to Coverity, by leaving out the return statement on this compiler. Apply the macro around the code base, using a clang-tidy transformer rule: const std::string unr = "unr", val = "val", ret = "ret"; auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(", ifBound(val, cat(node(val)), cat("")), ")"); auto ignoringSwitchCases = [](auto stmt) { return anyOf(stmt, switchCase(subStmt(stmt))); }; makeRule( stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)), nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))), {changeTo(node(unr), cat(makeUnreachableReturn, ";")), // TODO: why is the ; lost w/o this? changeTo(node(ret), cat(""))}, cat("use ", makeUnreachableReturn)) ); where nextStmt() is copied from some upstream clang-tidy check's private implementation and subStmt() is a private matcher that gives access to SwitchCase's SubStmt. A.k.a. qt-use-unreachable-return. There were some false positives, suppressed them with NOLINTNEXTLINE. They're not really false positiives, it's just that Clang sees the world in one way and if conditonal compilation (#if) differs for other compilers, Clang doesn't know better. This is an artifact of matching two consecutive statements. I haven't figured out how to remove the empty line left by the deletion of the return statement, if it, indeed, was on a separate line, so post-processed the patch to remove all the lines matching ^\+ *$ from the diff: git commit -am meep git reset --hard HEAD^ git diff HEAD..HEAD@{1} | sed '/^\+ *$/d' | recountdiff - | patch -p1 [ChangeLog][QtCore][QtAssert] Added Q_UNREACHABLE_RETURN() macro. Change-Id: I9782939f16091c964f25b7826e1c0dbd13a71305 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from container.count()/length() to size()Marc Mutz2022-10-043-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSslServer: Document undocumented signalMårten Nordheim2022-09-081-0/+7
| | | | | | Pick-to: 6.4 Change-Id: Ife21d43d682e9463d41a1dd8c377003fca6f120f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslServer: Re-enable read notifications when a client times outMårten Nordheim2022-08-191-0/+2
| | | | | | | | | | | Otherwise new clients will not be handled when they try to connect Amends 29a1fe72a0888eb1f22a5ae9fe1b3d87257f3246 Pick-to: 6.4 Change-Id: Ifff052d1bf27682df2782faa285a257c9b41d86f Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslServer: Make sure maxPendingConnections applies to all socketsMårten Nordheim2022-08-172-0/+7
| | | | | | | | | | Not just the ones we added to the pending sockets list Pick-to: 6.4 Change-Id: I0a0016fe39df7ca2fc3f0c4e4111195bc6d90198 Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSslServer: Implement handshake timeoutsMårten Nordheim2022-08-173-3/+67
| | | | | | | | | | | | | | | If a client doesn't send any data then we would leave the socket open for as long as it needed, wasting resources. Add timeouts to limit the amount of time this can happen for. Since there is a limit on number of sockets that the server will have queued, having idle sockets stick around forever is a vector for ddos. Pick-to: 6.4 Change-Id: Ida6251c92c625eeadf2065861b840b14255654b8 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSslServer: Check that first byte is ClientHelloMårten Nordheim2022-08-172-2/+82
| | | | | | | | | | SecureTransport ignores any content that comes in until it is large enough to be a handshake. So a plaintext client may be left hanging while it is waiting for a response. Pick-to: 6.4 Change-Id: I501ae61d89d516765c7ba5f0d916d9246fde5d4d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslServer: pass 'this' as a context to connections to socketMårten Nordheim2022-08-171-9/+9
| | | | | | | | | | Then we don't have to do a 'global' disconnect() on the socket object just to disconnect the QSslServer from the socket. Pick-to: 6.4 Change-Id: Ie3c9680db2717e21a0c548c74374a58d533534fe Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Add default value for seed param to all qHash overloadsKai Köhne2022-07-203-5/+1
| | | | | | Pick-to: 6.4 Change-Id: I4d559ccd60ec54d2584dceecaece7e0899c0eea9 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add the qt_class pragma to file listed in sync.profile classnames mapAlexey Edelev2022-06-222-0/+8
| | | | | | | | | This makes header files self-contained and reduces the number of 'sources of truth' for syncqt procedure. Change-Id: I7f5865abc69934603139d23e1b5452da46ccb110 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix typos in docs and commentsKai Köhne2022-06-151-1/+1
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Unify QSslServer from QtWebSockets and QtHttpServer into QtNetworkØystein Heskestad2022-06-043-0/+382
| | | | | | | | | | | | | Both QtWeSockets and QtHttpServer has a QSslServer class that is useful elsewhere. They are different though, so the new class has features from both versions. [ChangeLog][QtNetwork] Unify QSslServer from QtWebSockets and QtHttpServer into QtNetwork Task-number: QTBUG-100823 Change-Id: I523f04db39297ceb9b258f673eb12deecfc6886c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove mentions of SSL 3 in documentationMårten Nordheim2022-05-301-3/+3
| | | | | | | | | | And some s,SSL,TLS, in the same paragraphs. Changing SSL to TLS in the whole codebase looks odd given classes are still called QSsl*, but may be worth considering at some point. Pick-to: 6.3 6.2 Change-Id: I06dfcd99c1f6ac9e029e1914363344b3705d871f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1642-1600/+91
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtNetwork: includemocsMarc Mutz2022-04-281-0/+2
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: Ie027419956d98c971429f2b4c7ae6f8f56c094f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: replace remaining uses of QLatin1String by QLatin1StringViewSona Kurazyan2022-04-211-2/+2
| | | | | | | Task-number: QTBUG-98434 Change-Id: I0bb9d534ee42ccbf7d353e251ef58901a86923b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-213-36/+42
| | | | | | Task-number: QTBUG-98434 Change-Id: Ic235b92377203f7a1429ae7fd784c4a1fa893e9f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-214-10/+10
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: I121f87214b77aeab1dfd3e62dc5adaa6255cc0e0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [1/2]: ↵Marc Mutz2022-04-0512-7/+23
| | | | | | | | | | | | | | public API It's one of our best tools to improve compile times. Can't backport to Qt 6.3 or 6.2 because this change introduces new exported symbols. Task-number: QTBUG-102206 Change-Id: I6bfa532be34ca847d3b9034d16c94efed3d602c3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Short live Q_CONSTINIT!Marc Mutz2022-03-261-1/+1
| | | | | | | | | | | | | | | | | | It expands to the first available of - constinit (C++20) - [[clang::require_constant_initialization]] (Clang) - __constinit (GCC >= 10) Use it around the code (on and near static QBasicAtomic; this patch makes no attempt to find all statics in qtbase). [ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT. Fixes: QTBUG-100484 Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>