summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Mark QWebSocketHandshakeOptions() move-constructor as noexceptEdward Welbourne2022-04-052-2/+2
| | | | | | | | CodeChecker says it should be so marked. Apparently this is good for performance. Change-Id: I93fc95fd61ae37fe7a8927f9fbfb593acabb74ca Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix handshake looping infinitely making no progressMårten Nordheim2022-04-011-6/+9
| | | | | | | | | | | | | | | | | | | The processHandshake function may make no progress and return. The loop calling processHandshake previously had no way of knowing this and would happily loop forever despite the outcome being the same every time. This was particularly noticeable with any response that doesn't include the \r\n\r\n sequence the first time we call processHandshake. Since processHandshake either fails or succeeds, not performing any partial-reads, we simply move it out of the loop and restructure some of the code around it. Pick-to: 6.3 6.3.0 Fixes: QTBUG-102111 Change-Id: I3955e4b90eb1be0a0ef5dfcf8a46921a086a8b49 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add support for WebSocket Sub-ProtocolsArno Rehn2022-03-3018-42/+611
| | | | | | | | | | | | | | | | | Sub-Protocol support follows RFC 6455 Sections 4.1 and 4.2. See also https://datatracker.ietf.org/doc/html/rfc6455. This patch introduces a new class QWebSocketHandshakeOptions which collects options for the WebSocket handshake. At the moment, this contains only accessors for sub-protocols. In the future, it can be extended with things like WebSocket extensions. [ChangeLog] Add support for WebSocket Sub-Protocols Fixes: QTBUG-38742 Change-Id: Ibdcef17f717f0a76caab54f65c550865df1ec78d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Revise Qt WebSockets module landing pageAndreas Eliasson2022-03-281-33/+33
| | | | | | | | | | Remove the include directive section and add the global CMake and qmake snippets. Also, reorganize some of the sections structure. Task-number: QTBUG-100369 Pick-to: 6.3 6.3.0 Change-Id: Ief7a5f845df5b2edaa17c3c652895a4adb7ad3a5 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2022-03-221-25/+0
| | | | | | Pick-to: 6.3 Change-Id: Icaf0fac81f51432c706a948d0986aae68e44fffb Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Make sure all private headers include at least one otherThiago Macieira2022-03-085-2/+5
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix order of signals around disconnectionJoni Poikelin2022-02-011-3/+1
| | | | | | | | | | | | | | | | readyRead() signal had been connected with QueuedConnection which caused disconnected() signal to sometimes come before last message signals of a connection. Reasoning for this was some issue regarding SSL sockets, but there is a good chance it has been fixed since then. Removing this doesn't seem to cause hangs now at least. Fixes: QTBUG-100054 Pick-to: 6.3 6.2 Change-Id: Id465916d111a5520f4039cf57f822918f3afbca0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Style fix: dedent closing doc tagsArno Rehn2022-01-242-17/+17
| | | | | Change-Id: Id590e49c6d80f562d29e26404285f177bd0ee840 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix setting of socket optionsJoni Poikelin2022-01-121-4/+8
| | | | | | | | Socket options need to be set after connectToHost() to take any effect. Change-Id: I006a8c59ba1c78d5edaa77d545bb0f640b7224fe Pick-to: 6.3 6.2 5.15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port QWebSocketProtocol::versionFromString() to QStringViewMarc Mutz2021-12-173-4/+5
| | | | | | | | | It's not public API, so there's no point in using QAnyStringView here. We control all callers. Pick-to: 6.3 Change-Id: I1ca9135b4fa7d435e5a21534842c002509f1b7ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWebSocketProtocol: fix potential UB (signed overflow) in masking operationMarc Mutz2021-12-171-1/+1
| | | | | | | | | | | | The size of the payload is a 64-bit integer, which the loop counts down. If the size is > INT_MAX, then we'll overflow the int i used to track the current position in the mask. Fix by using an unsigned integer type instead. Pick-to: 6.3 6.2 5.15 Change-Id: Ia3b8d42ae906eb03c1c7399cb1137a08121fcde3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Reuse qtbase's HTTP header parser to avoid a reinvented wheelØystein Heskestad2021-12-094-103/+68
| | | | | | Fixes: QTBUG-80700 Change-Id: I7b713fd869ac802d5eee8ebb8d90a2115365b509 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix typo in \qtcmakepackage commandPaul Wicking2021-10-211-1/+1
| | | | | | | | | The correct CMake package name is WebSockets Pick-to: 6.2 Fixes: QTBUG-97681 Change-Id: I434cfce2e0d7fb91534718becb953a1b94e16d16 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Reuse header http parsing code from QtNetworkØystein Heskestad2021-10-083-180/+104
| | | | | | | Fixes: QTBUG-80701 Change-Id: Ic430a7dbc4448fc6d5fc000129a8e08bbed7e77d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Correct a recently introduced typo in an \externalpage linkLuca Di Sera2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | Commit bfa705a7a20576405e77be28d185c84f96c1acd0 recently modified the link to the "Talking to Yourself for Fun and Profit" paper. While the new location for the `\externalpage` link is correct, it was erroneously introduced with a typo in it. In particular, `fd` was introduced in front of the `org` domain such that the link was incorrect. The typo is now removed such as to correct the link. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: Ie4d169a978767b77f6d59b2ef135b3a3a8a0131d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Repair broken link to a websocket paperLuca Di Sera2021-10-041-1/+1
| | | | | | | | | | | | | | | The `\externalpage` link to the "Talking to Yourself for Fun and Profit" paper, presented at the Web 2.0 Security and Privacy 2011 conference, pointed to the version hosted on the `w2spconf` domain, which is not available anymore. To repair the broken link, it was changed to point to an equivalent version stored on the `ieee-security` site. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: Id68c5947fa285062fa69a35fa9641e88118448ba Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Migrate to autogenerated cpp exportsAlexey Edelev2021-09-272-13/+2
| | | | | | | | | Replace the hardcoded cpp exports with a generated one where it's applicable. Task-number: QTBUG-90492 Change-Id: Idc2d2d9f7ba2abbff462a27599b9a7b1aa704a4f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Update \externalpage links to RFCsLuca Di Sera2021-09-171-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The old `tools.ietf.org/html/*` web pages containing RFCs now redirect to `datatracker.ietf.org/doc/html/*`. While the redirection work, our script to catch broken links on dev-snapshots builds of the documentation doesn't handle redirection correctly, reporting it as broken. Both to appease the broken-links script and to avoid an unneccesary redirection the RFC links in `external-resourced.qdoc` were modified to point to the new domain. Furthermore, the link referring to a specific page that pointed to a section were updated to point directly to the section, so that they are consistent with other similar links. The `tools.ietf.org/id/*.txt` links, while still resolving without a redirection, were updated to use an equivalent link on the `datatracker.ietf.org` domain for consistency. Task-number: QTBUG-96127 Pick-to: 6.2 6.2.0 Change-Id: I0b937c9dbfaec0cd4b2aad5bd55fc731d073ca16 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix documentation warningsTopi Reinio2021-09-082-2/+2
| | | | | | | | | | * Rename a file included by QDoc to have the correct extension * Add missing \a command to mark a function argument Pick-to: 6.2 Fixes: QTBUG-96287 Change-Id: I9724b67f641ba634c91a74e3e05821f1edfeb4ad Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Use https links for tools.ietf.org linksTimofey Sartakov2021-09-073-13/+13
| | | | | | | | | | Use https links for http://tools.ietf.org links. Currenly docs seems to be available on datatracker.ietf.org domain only, and redirects set up only for https. Http links may not work, if browser does not try to use https. Change-Id: I1f656c10e7478b97ce229c48ad270338bc460d3b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update changes doc with the singular changeAllan Sandfeld Jensen2021-08-252-0/+41
| | | | | | | | | Only the removal of the deprecated API. Pick-to: 6.2 Fixes: QTBUG-94932 Change-Id: Ib7de6b11701d4f39273eb33e75e1cc8fe2deeae3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Remove unsupported customFiltersKai Köhne2021-08-251-4/+0
| | | | | | Task-number: QTBUG-95987 Change-Id: I48eac76d28f4be45f55b1e1cb7183c7a72fe0b17 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Reinstate transitional methodsAllan Sandfeld Jensen2021-08-201-0/+6
| | | | | | | | | These were introduced in Qt5 as transitional methods, and deprecating the main methods. They should still be here to support API conversion. Pick-to: 6.2 Change-Id: I251c97dca527971bf966335288855aeea10572d2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Document new QWebSocketServer signalsKai Köhne2021-08-121-0/+41
| | | | | | | | | Note that, in contrast to QWebSocket, QWebSocketServer misses the continueInterruptedHandshake() method. Pick-to: 6.2 Change-Id: I6d38fa5a814732da40b1941decbe5cd7492bc39f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Add Changes Qt 5 to Qt 6 page to Qt WebSocketsPaul Wicking2021-08-041-0/+44
| | | | | | | | | Add a basic changes page for consistency with other modules. Task-number: QTBUG-94932 Pick-to: 6.2 Change-Id: I21428ba4bef08b4a9b50386d03c391d13f5545d0 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove outdated qmake pro-filesØystein Heskestad2021-07-204-77/+0
| | | | | | Task-number: QTBUG-95167 Change-Id: I32f5c1f9d3a1a7cfd1c7ceea6a887418789bc63a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Update since markersAllan Sandfeld Jensen2021-07-161-5/+5
| | | | | | | | | Qt 6.2 will be first Qt 6 release for Qt WebSockets Pick-to: 6.2 Change-Id: I2141785c3f5bf6604418e3d1b8d8c311c916400d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Don't give plugins PUBLIC usage requirementsJoerg Bornemann2021-07-061-2/+1
| | | | | | | | | | | | | | | | | | | | The pro2cmake.py conversion script faithfully reproduced the .pro files for the plugins, which specified the libraries as public. But in CMake, the implications of this are that public usage requirements should then be propagated to consumers. We don't expect any consumers, since a plugin is created as a MODULE library in CMake, so for Windows we don't even have an import library to link with. The only exception to this is for static builds where plugins are created as STATIC libraries instead, but only in certain controlled situations do we then link to plugins. Even then, usage requirements are not expected to propagate to the consumers, so these relationships should always be specified as private. Pick-to: 6.2 Task-number: QTBUG-90819 Change-Id: I8a7cc92826709267cc44b210c64fb3940ea20eee Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Clear frame before emitting signals to prevent duplicating messagesØystein Heskestad2021-06-251-3/+7
| | | | | | | | | [ChangeLog] Clear frame before emitting signals to prevent duplicating messages Fixes: QTBUG-87279 Pick-to: 6.2 Change-Id: Iab296f443943eeec3b2a0fbb4f79c5abb2605ca7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Pass ignoreSslErrors to unterlying QSslSocketJens Trillmann2021-06-221-0/+5
| | | | | | | | | | | | When setting ignoreSslErrors(List<QSslError>) during the sslErrors signal handling the call got ignored. Only the internal config for creating a QSslSocket would be updated but not the current QSslSocket. The request of the caller to ignore specific QSslErrors would be ignored. Pick-to: 5.12 5.15 6.2 Change-Id: I6aaea2111fe1d26e07e6eaaa7532ae1b14a187a8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix QScopedPointer usage warningsAllan Sandfeld Jensen2021-06-212-14/+9
| | | | | | | | | | Switching to std::unique_ptr since we move the data, and mark move operators noexcept. Pick-to: 6.2 Change-Id: I8548a0a2b07cb5108823a081dd1ea68e4bb1800d Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port to new CMake API for QMLUlf Hermann2021-06-053-19/+8
| | | | | | | | | Do a purely syntactical conversion that leaves all the old code intact. Porting to declarative type registration etc shall be done in a separate step. Change-Id: I8322efe8160f2d6761817cb89d5369b15a63a952 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Clear frame on reconnectAllan Sandfeld Jensen2021-01-251-0/+1
| | | | | | | | | | | Otherwise partial data could leak through to next connection and cause odd behavior Pick-to: 5.15 Fixes: QTBUG-88923 Change-Id: I6c75e6325527379bcdca0b9819a89437d0658893 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add doc note about internal ping/pong handlingAndre Hartmann2020-12-211-0/+3
| | | | | | | Pick-to: 5.15 Change-Id: Ic74407b17d03fbfd3077ac1dd4f689a7207ccb51 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate projects to use new CMake APIAlexandru Croitor2020-12-103-6/+6
| | | | | Change-Id: Iaaa4a44c8cf8735aa17293540e701ababace8155 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove Qt5 leftoversPeter Varga2020-12-019-194/+2
| | | | | Change-Id: Ifecb6f90687601a20e719db3ba194e33f3303f24 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace old Q_DECL_NOEXCEPT macros with modern C++Allan Sandfeld Jensen2020-10-302-4/+4
| | | | | Change-Id: Iab7b0c45ef3e5c8c042aa906f5eb4d9142b0f6d9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QByteArray operator of QStringDecoderAndré Klitzing2020-10-211-3/+2
| | | | | | | | | | | qwebsocketdataprocessor.cpp:203:72: error: no match for call to '(QStringDecoder) (const char*, qsizetype)' frame.payload().size()); qwebsocketdataprocessor.cpp:293:86: error: no match for call to '(QStringDecoder) (const char*, qsizetype)' closeReason = toUtf16(payload.constData() + 2, payload.size() - 2); Change-Id: Ia56b7b0b6e184ed95abf105d22149b4e07f18551 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Update dependencies on 'dev' in qt/qtwebsocketsAllan Sandfeld Jensen2020-09-211-1/+1
| | | | | Change-Id: I2f5660c165dbdc504c66ec8d04ab97c349b197fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix compilation by replacing QStringRef with QStringViewMarcel Krems2020-08-201-1/+1
| | | | | Change-Id: I3f34797df1fbf25be03c4d548d8d59df68794f1e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix build against latest qtbaseMaurice Kalinowski2020-08-182-0/+2
| | | | | Change-Id: Ibeb6f1a596cb93e2c2f5dd841cd568dea9e637d8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Change return type from QMap to QMultiMapMarcel Krems2020-08-102-2/+2
| | | | | | | | | QMultiMap no longer inherits QMap which causes the conversion to fail: error C2440: 'return': cannot convert from 'const QMultiMap<QString,QString>' to 'QMap<QString,QString>' Change-Id: Ie9c0b2588d0b0c27a81949926b36800f6f6c354c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Remove 'nolink' hack for WebSocketsTopi Reinio2020-07-021-21/+0
| | | | | | | | | | | This was used for preventing unwanted auto-links. We have since introduced a different mechanism to handle these (the 'ignorewords' qdocconf variable), and this workaround now causes problems. Pick-to: 5.15 Fixes: QTBUG-85388 Change-Id: Ife6183accf46a3b47f2dc6c988e40cf8f9f24e49 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update dependencies on 'dev' in qt/qtwebsocketsLiang Qi2020-07-014-10/+10
| | | | | | | | Also adapt to qtbase 45c0f45e04, Move QAlertLevel and QAlertType enums into the namespace QSsl. Change-Id: I3ddbbdaf22127fe0478ce7fac5879ed36bea0b30 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QSslServer - adopt the newly created socketTimur Pocheptsov2020-06-261-1/+1
| | | | | | | | | | | | | | | Like it's done in QTcpServer. In theory, it's possible that 'encrypted' signal is never executed and then the socket is not added to the pending connections (those are deleted in the QTcpServer::close). Thus, the socket object would be leaked. Since QSslServer inherits from QTcpServer, this fix also ensures the documented behavior of the QTcpServer::nextPendingConnection (which is said to return a child of the server object). Fixes: QTBUG-85180 Pick-to: 5.15 Change-Id: Ic0d923b7a7fe5e3bcea0b9815be1cbe946dda186 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Update docs with cmake package informationNico Vertriest2020-06-251-0/+1
| | | | | | Task-number: QTBUG-85179 Change-Id: Id248fda5c1dd7fc2df3f030040b5b64f4af4e73c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate projectsAlexandru Croitor2020-06-242-5/+3
| | | | | | | | | | Mostly needed for src/ project, to build websockets without checking for the textcodec feature. Amends aeeaa00fa083ac339d0770d633d22f203c504253 Change-Id: I90cd219294575c763501e47b9025e8a50017641a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-233-3/+3
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I36460d504aaac08bdbb64b6c71b5ab10e062e00d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port QtWebSockets from QTextCodec to QStringDecoderKarsten Heimrich2020-06-183-36/+16
| | | | | | Task-number: QTBUG-75665 Change-Id: I957e853aef6a4e53bf0c2a0ff4ceac80522ba00f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add missing overrideAlexander Volkov2020-05-201-1/+1
| | | | | Change-Id: Ife1899ec8516a7d8b790c2321b6cd61e57772eec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>