aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into ↵v5.15.9-lts-lgplTarja Sundqvist2023-03-232-5/+9
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I7754f1f94b830ea63edad5e7705ece5d0007c47c
| * 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 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 647922b1122977625b8f32fbc0bb2e9339afb4a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * 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. Change-Id: Ia3b8d42ae906eb03c1c7399cb1137a08121fcde3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 38218494a65049b5f9da7a8aab012a969c7dac86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into ↵v5.15.6-lts-lgplTarja Sundqvist2022-08-162-3/+12
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ia4e6ffc419e24148f37c89e661ad7b2558f53371
| * Clear frame before emitting signals to prevent duplicating messagesØystein Heskestad2021-06-301-3/+7
| | | | | | | | | | | | | | | | | | [ChangeLog] Clear frame before emitting signals to prevent duplicating messages Fixes: QTBUG-87279 Change-Id: Iab296f443943eeec3b2a0fbb4f79c5abb2605ca7 (cherry picked from commit d196801706821a890bda8b22508c2957a50eff25) 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. Change-Id: I6aaea2111fe1d26e07e6eaaa7532ae1b14a187a8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit b13f23d232cfdd372ef812d427872d52eed2337e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-2236-710/+710
|/ | | | | | | | | | | This reverts commit 43f9a2dbf9bff83203db4ebe969af3d0523ae5c5. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: Ic420c5575da14b99e48eb620d9e8dc63fb6a02f0 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-2736-710/+710
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtwebsockets. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4218 Change-Id: I91525398b24d696254f551f3db57107b5197e38f Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Clear frame on reconnectAllan Sandfeld Jensen2021-01-261-0/+1
| | | | | | | | | | | Otherwise partial data could leak through to next connection and cause odd behavior Fixes: QTBUG-88923 Change-Id: I6c75e6325527379bcdca0b9819a89437d0658893 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 9f6449ef1b6d1e7651f181585f1c35d6722bb87a)
* Add doc note about internal ping/pong handlingAndre Hartmann2020-12-211-0/+3
| | | | | | | | Change-Id: Ic74407b17d03fbfd3077ac1dd4f689a7207ccb51 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit fa6c7e50321e7be048297e5d0ce8503647a9488e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWebSocket: websocket is a websocket, not a TLS socket necessaryTimur Pocheptsov2020-11-242-2/+18
| | | | | | | | | So we delay TLS initialization until it's really required (wss scheme found etc). Fixes: QTBUG-88663 Change-Id: I0c1cfa03b189bfa8e41aad27918fe1998de19ea7 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. Fixes: QTBUG-85388 Change-Id: Ife6183accf46a3b47f2dc6c988e40cf8f9f24e49 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 4b8f290571d1e3a2f291a07796e0cd4ac2745f74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: Ic0d923b7a7fe5e3bcea0b9815be1cbe946dda186 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 788d4856330e6f5d251f9b153de3d22b8cf538f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make sure child QObjects get moved-to-thread along with the ownerMårten Nordheim2020-05-184-25/+25
| | | | | | | | | | | | | | | | By parenting them. And to do that without crashing they need to be allocated dynamically. A couple missed "parenting"s caused the object to not be moved to the other thread when the websocket was moved. This caused it to print warnings when the timer was started and stopped since this cannot be done across threads. Fixes: QTBUG-83722 Change-Id: Iee60fe1c498f8f6d1e0c2cfcb2923bd5b9560acb Reviewed-by: Jesus Fernandez <jsfdez@gmail.com> (cherry picked from commit 393fcf8a64748f0c59f47d254667518dba9e2fc3) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QAbstractSocket: Fix warnings from deprecated error signalv5.15.0-beta4v5.15.0-beta3Mårten Nordheim2020-03-231-2/+1
| | | | | | Task-number: QTBUG-82605 Change-Id: Ibaa722ae26a71680426cecc3a0e25acc72d9527b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add a public api to set max frame and message size (CVE-2018-21035)Franck Dude2020-03-198-10/+285
| | | | | | | | | | | | | This change allows the user to set a lower allowed frame/message size for reception. The purpose is to avoid an attacker to exhaust the virtual memory of the peer. Fixes CVE-2018-21035 [ChangeLog] Added public API to set the maximum frame size and message size Task-number: QTBUG-70693 Change-Id: I5dc5918badc99166afdcc8d9c6106247a9f8666f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-03-022-8/+6
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: If65be10a7c86e7b4173fd31f1d277c63c6accb0a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Revert "QWebSocket - do not use deprecated member-function"Allan Sandfeld Jensen2020-02-271-1/+1
| | | | | | | | | This reverts commit 938ad6373415fa8b0767a987c37ce51ec546859f. Reason for revert: Was undeprecated and replacement removed Change-Id: I79d6e931d72ec518a43fe058e1067b3754f6cf05 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* WebSocketServer: Add Q_(UN)LIKELYAndre Hartmann2020-02-261-6/+6
| | | | | | | | ... to optimize code that is used for error handling. Change-Id: I62fe11d34d32c6784e960505fccbf529a3265d23 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update plugins.qmltypes for 5.15Jani Heikkinen2020-02-251-1/+1
| | | | | | Task-number: QTBUG-82253 Change-Id: I90199c05f683df18dffe796227fc8e4c0ef9f72d Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-251-2/+3
|\ | | | | | | Change-Id: I69ac9d8a828ba664e38b1f5abdfd0830f55c134e
| * Doc: fix missing closing commentAndre Hartmann2020-02-241-0/+1
| | | | | | | | | | Change-Id: I2e1f4893b1b4c1270630101c390b937611e5d5e2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Doc: fix links to autobahn testsuiteAndre Hartmann2020-02-241-2/+2
| | | | | | | | | | | | Fixes: QTBUG-69425 Change-Id: I28e03da927c7a9b1cbfb91a0aca32866c2e653ea Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | Change QMap to QMultiMapMårten Nordheim2020-01-234-6/+6
| | | | | | | | | | | | | | Because insertMulti is deprecated Change-Id: I3965ea7159b2516b35c45072115eba1ab621b89a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QWebSocket - do not use deprecated member-functionTimur Pocheptsov2020-01-151-1/+1
| | | | | | | | | | | | | | | | Use 'socketError' instead. Task-number: QTBUG-80369 Change-Id: I30527721677be0fc0f71ca33b08f608472bc8b71 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-142-7/+2
|\| | | | | | | Change-Id: Icd1a2fd565d5d85ac6d1378578a92dbb1a9692ce
| * Remove extra deleteLater (already done in onSocketDisconnected)Franck Dude2019-12-131-1/+0
| | | | | | | | | | Change-Id: I671d93ccd766fed4fff797930804ab748cbb27a1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Don't add port in Host header unless specifiedLander Noterman2019-11-211-6/+2
| | | | | | | | | | | | | | | | | | | | | | No longer add port to Host header in WebSocket handshake unless it was explicitly specified in the URL. This change fixes issues with some WebSocket servers rejecting the connection if the Host header does not match the URL. Fixes: QTBUG-77526 Change-Id: I9b028ce434416e61cae7b217d2eafe621d2660b4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Add protection against handshake header too largeFranck Dude2019-12-131-1/+9
| | | | | | | | | | | | Task-number: QTBUG-70691 Change-Id: I54b9f7157e5830b9efd8bae7d4777218857249b1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Fix websocket handshake request header parsingFranck Dude2019-12-133-8/+33
| | | | | | | | | | | | | | | | | | | | | | Header ends with \r\n\r\n but there might be more data inside the tcpbuffer Never read past the header Task-number: QTBUG-70000 Change-Id: If3d4cb362646e43a91faf00f89e50510ff00fa56 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Cleanup QWebSocketFrameChristian Ehrlicher2019-11-262-147/+15
|/ | | | | | | | | | | Remove QWebSocketFrame assignment and move stuff by our own - the default ones are good. Also reorder the members to reduce the padding (56 to 48 bytes on 64bits). Change-Id: Ib4628628af924c36ad3cd9bf67ce72752ef97ff5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Remove broken documentation commentsTopi Reinio2019-11-111-25/+0
| | | | | | | | | | | | | QWebSocketServer::nativeDescriptor() and its setter were documented twice, with the duplicated versions under Qt6-specific version check macro and marked \deprecated. QDoc still parses those in Qt5 as it doesn't respect the version guards - remove the offending comments for now. Fixes: QTBUG-79816 Change-Id: Ie40190c9d32f91efd3428b7f884c9ad923a2bb0e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update plugins.qmltypes for 5.14Kai Koehne2019-10-221-1/+1
| | | | | | | Task-number: QTBUG-78690 Change-Id: Ie1de2c3cf46edca2b1441ff94a9bb50cb507c057 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add support for chrono versions of handshakeTimeout functionsv5.14.0-beta2Mårten Nordheim2019-10-092-4/+34
| | | | | | | | | | | | | And rename the int-version of the getter to enable the scenario where someone does not have chrono. From the 5.14 API change review. Amends 2e54dbe86eac61e87782a138dbcc158cb6b10cd9 Change-Id: Icf2f2a3aebc2216defd0a3a569544c4270ddf05a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-171-4/+12
|\ | | | | | | Change-Id: I4052a4c238a0c59b1a0fc01ad3fd6ee6b714595b
| * wasm: make sendBinaryMessage work in threaded modeMorten Johan Sørvig2019-09-131-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two issues in sendBinaryMessage(), one observed, and one theoretical: 1) WebSocket send() does not accept data views backed by SharedArrayBuffer, which is the case for heap memory views when threading is enabled. 2) We have no way of observing for how long send() will retain the memory view passed to it. This means we don’t know when the QByteArray can be safely freed. Both can be solved by copying the payload data to a separate ArrayBuffer, whose lifetime can be managed by WebSocket. Fixes: QTBUG-78078 Change-Id: I73209080db66f38b971f2c8a727b43402357b1a9 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Add missing \since 5.14 to new APIMårten Nordheim2019-08-301-0/+2
| | | | | | | | | | | | | | | | | | | | From API review. Amends 2e54dbe86eac61e87782a138dbcc158cb6b10cd9 Change-Id: Ie55a3ef076e042e4461397996e19bf7d397c3fb5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* | Take 2: Properly handle multiple websocket frames in one TCP frameMårten Nordheim2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Gerrit ate my change and somehow created an impossible state where a patch was able to merge due to its fix but couldn't actually pass its tests. Amends 6e1fa958c289de639753a60a9384bd94db0e91a8 Task-number: QTBUG-77830 Change-Id: Iedc23616816bb2c1758969a1d76b9536b509c38a Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* | QWebsocket doesn't receive message with size larger than 1MRyan Chu2019-08-283-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | If the processing of QWebSocketFrame is not done and waiting for more data, QWebSocketPrivate::processData should return the control and wait for next readyRead signal. Continue the change of b2fc794ffaf48c9d9c401b54cf39ea0220617a27 Change-Id: Idf5af0710267e59e63b8e234d6dab5843d821696 Reviewed-by: Jesus Fernandez <jsfdez@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge dev into 5.14Kari Oikarinen2019-08-275-192/+225
|\ \ | | | | | | | | | Change-Id: I2eaffbe6e9519a78d0f8663c0870f24cb006d222
| * | Remove waitForReadyRead from QWebSocketFrame::readFrameRyan Chu2019-08-235-36/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asynchronously process socket frame in QWebSocketDataProcessor::process. If the processing of QWebSocketFrame is not done and waiting for more data, QWebSocketDataProcessor::process will return the control and wait for next readyRead signal to continue processing the unfinished socket frame. QWebSocketDataProcessor::process gets timeout after 5 seconds, and then an errorEncountered signal will be emitted. Fixes: QTBUG-74464 Change-Id: I03b7f874c1c266617e7eadf59c59ae43fa8540ce Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | Make QWebSocketFrame::readFrame as a non-static public functionRyan Chu2019-08-234-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The static function QWebSocketFrame::readFrame used to return a parsed QWebSocketFrame read from QIODevice. This change make QWebSocketFrame reusable. It will base on its internal state and keep processing the incoming data from QIODevice. Change-Id: Ic6dea59529fa935cdb8034519e633ea67e869674 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Add an internal state to keep the processing state of frame readingRyan Chu2019-08-232-52/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro 'WAIT_FOR_MORE_DATA' is revised because the processing state is kept by m_processingState. Remove the unused dataWaitSize and returnState local variables from QWebSocketFrame::readFrame. Change-Id: I8e270c5c7117b170159d4fb3b2bf1531a9cd5334 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Divide QWebSocketFrame::readFrame into subroutinesRyan Chu2019-08-232-142/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To reduce the dependency of each state and remove local variables (bytesRead, hasMask, and payloadLength) from QWebSocketFrame::readFrame, this change breaks down the states of QWebSocketFrame::readFrame into subroutines. In this change, it uses a readFramePayloadLength function to handle PS_READ_PAYLOAD_LENGTH and PS_READ_BIG_PAYLOAD_LENGTH cases. In addition, a missing error-handling is added in the read-header case if the bytesAvailable is less than 2 bytes. The variable hasMask is replaced by transiently using m_mask to indicate whether to read a mask. After reading mask in readFrameMask, the transient value will be over-written and used in readFramePayload. To replace local variable payloadLength with QWebSocketFrame::m_length, m_length is expanded to hold the payload length. Change-Id: I1c2d197112cef5cea75215923fa28e6f2e6cbef8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Use QElapsedTimer instead of QTime for the ping timerFriedemann Kleint2019-08-232-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The use of QTime for determining intervals is deprecated: qwebsocket_p.cpp:1214:61: warning: ‘int QTime::elapsed() const’ is deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations] Change-Id: I26e1dabcba5ba54a4fead02b43c3fe7ace740be0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Prospective fix for compilation with WebAssembly/MinGW73Friedemann Kleint2019-08-221-3/+6
|/ / | | | | | | | | | | | | | | | | | | Pass a template argument to std::less/greater. Amends 54ffd0d0a3bf2c77d53e1cdfe04b362f59682cb4. Fixes: QTBUG-77500 Change-Id: I0b78906090d8b0e3c910104975c08ff79ba9fc12 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-161-0/+1
|\| | | | | | | Change-Id: Ifa55b6563a15a91d7906d9e84936c4484323f809
| * Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-07-091-0/+1
| | | | | | | | | | | | Task-number: QTBUG-74391 Change-Id: I4f5a70c7439b27db2b02907e460b5804d5c6e104 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-291-3/+5
|\| | | | | | | Change-Id: I2a1987a687fafb73b3b8368db93bcca7a91bb5d0
| * Doc: Complete parameter description several methodsNico Vertriest2019-06-181-3/+5
| | | | | | | | | | Change-Id: Ib9f98683faf2b3a4041371c80a31de1f0902261d Reviewed-by: Paul Wicking <paul.wicking@qt.io>