aboutsummaryrefslogtreecommitdiffstats
path: root/src/websockets/qwebsocket_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into ↵v5.15.9-lts-lgplTarja Sundqvist2023-03-231-4/+8
|\ | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into ↵v5.15.6-lts-lgplTarja Sundqvist2022-08-161-0/+5
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ia4e6ffc419e24148f37c89e661ad7b2558f53371
| * 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-221-19/+19
|/ | | | | | | | | | | 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-271-19/+19
| | | | | | | | | | | | | | | 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>
* QWebSocket: websocket is a websocket, not a TLS socket necessaryTimur Pocheptsov2020-11-241-1/+0
| | | | | | | | | 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>
* Make sure child QObjects get moved-to-thread along with the ownerMårten Nordheim2020-05-181-17/+16
| | | | | | | | | | | | | | | | 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-191-6/+83
| | | | | | | | | | | | | 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-021-2/+1
| | | | | | | | 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>
* Change QMap to QMultiMapMårten Nordheim2020-01-231-2/+2
| | | | | | | 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-141-6/+2
|\ | | | | | | Change-Id: Icd1a2fd565d5d85ac6d1378578a92dbb1a9692ce
| * 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>
* | Fix websocket handshake request header parsingFranck Dude2019-12-131-1/+5
|/ | | | | | | | | | | 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>
* 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-281-2/+2
| | | | | | | | | | | | 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-271-2/+2
|\ | | | | | | Change-Id: I2eaffbe6e9519a78d0f8663c0870f24cb006d222
| * Remove waitForReadyRead from QWebSocketFrame::readFrameRyan Chu2019-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Use QElapsedTimer instead of QTime for the ping timerFriedemann Kleint2019-08-231-0/+2
|/ | | | | | | | | 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>
* wasm: fix validity statev5.13.0-beta1Lorn Potter2019-03-111-0/+2
| | | | | | | Fixes:QTBUG-73689 Change-Id: I5993eb38a8fc45a06a8ced46f71034e4b87ec67b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Set the protocol type so that PAC scripts handle ws/wss correctlyAndy Shaw2018-12-261-0/+2
| | | | | | | | | On macOS it will only allow proxies in a PAC script to use http/https protocols, so this enables them to work by automatically setting these as the type instead. Change-Id: I66589057d40d135229cbae4986ef0819287ea69a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove unneeded CRLF ending from status lineAleksey Lysenko2018-12-211-1/+1
| | | | | | | | | No need to keep the CRLF ending of status line. Task-number: QTBUG-67424 Change-Id: I7f94c7bedf40412b338c56cfe59751f6a9e78f0a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add support for WebSockets on Qt for WASMLorn Potter2018-09-201-0/+8
| | | | | | | | | Implement the QWebSocket API using HTML WebSocket. Change-Id: I2284f8606d512943d2abc2a96fc48effcc45a786 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Remove unnecesary default labelJesus Fernandez2018-08-141-2/+0
| | | | | | Change-Id: I994b34614b2e2ee95fed145e7f5dcd873ff7c3f4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix conversion warningsJesus Fernandez2018-08-141-8/+12
| | | | | | Change-Id: I087b72412db19f34b8e890ddc6a3a0fcdd434141 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use QObjectPrivate::q_ptr instead of shadowing itJesus Fernandez2018-08-141-9/+6
| | | | | | | | | | Some private classes had a q_ptr pointer shadowing the QObjectPrivate::q_ptr pointer. Q_Q casts the QObjectPrivate::q_ptr pointer to match the public class so there is no need to store a different pointer. Change-Id: I8f5c4323b1dcf45a9796c0dd9f522bdbc63add18 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-3/+7
|\ | | | | | | Change-Id: Iffe66da51d3b7b38d04ca3c185b3b003b157f886
| * Limit Close frame to 125 bytesMårten Nordheim2018-08-061-3/+7
| | | | | | | | | | | | | | | | | | | | | | All control frames should be limited to 125 frames. https://tools.ietf.org/html/rfc6455#section-5.5 Task-number: QTBUG-62949 Change-Id: Id9b5a431faab6ff6edf7dc2e5c3525e999bc04ea Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Use QUrl::toString() when forming the 'Host' headerTimur Pocheptsov2018-05-161-10/+12
|/ | | | | | | | | | This allows to correctly use IPv6 literals and also deals (correctly) with a port (if it's set at all). Task-number: QTBUG-68245 Change-Id: I6d29543887c4ab58d70f0970a6f0a1b822c301df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWebSocket: fix bytesWritten being emitted twiceMårten Nordheim2018-04-181-2/+0
| | | | | | | | Because it was connect-ed twice. Task-number: QTBUG-67778 Change-Id: Ia19d2471c148c615faceb7548566d819683c2193 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Make HTTP header parsing RFC-compliantRobert Griebl2017-11-281-7/+23
| | | | | | | | | | | All this home-grown parsing should be replaced with code from the qhttp* classes. This would result in a big refactoring though, so this commit at least tries to make the header parsing RFC compliant and not choke on perfectly legal "Header:Value" messages. Change-Id: I14303610dc7187b8d8595568fb221c18e4e0d515 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-0/+3
|\ | | | | | | | | | | | | | | Conflicts: src/websockets/qwebsocket_p.cpp tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp Change-Id: I40922fab198a09a3fbba1b2f11b42f2d40e53720
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-301-0/+3
| |\ | | | | | | | | | Change-Id: I3ae5df71f201cfdb9a4c9e7d90a60d1f9792700a
| | * Fix empty sslConfiguration in sslErrors slotAndré Klitzing2017-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QWebSocket fires signal sslErrors the QSslConfiguration of QWebSocket is not updated. So client application cannot check it in implemented slot. Fix this by calling the update method like for encrypted signal. Sibling of QTBUG-40401. Change-Id: I18b39f6b6a0791ae67fc2bff5cf2c04a22b0ab85 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Replace typedefs by QOverloadAndré Klitzing2017-10-301-6/+3
| | | | | | | | | | | | | | | | | | Change-Id: I509332fa23bcf2cf2e6c10b7edacb4157f025ff9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-111-3/+4
|\| | | | | | | | | | | | | | | | | | | | Conflicts: examples/websockets/simplechat/chatserver.cpp Change-Id: I98697cef4c05516b5b4122ad81c084546d57115f
| * | Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta3v5.10.0-beta2Liang Qi2017-10-111-2/+3
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I4af142703e469b56236b73335a93f6960534c0f1
| | * Change assert to null-checkMårten Nordheim2017-09-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids a crash that would happen if readyRead was emitted after calling ::close on the websocket. Task-number: QTBUG-59179 Change-Id: I1e7bd19d99ee068b8699014fac9a72f839632c85 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * Fix releaseConnectionsAlan Alpert2017-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overload selected when you pass a single object pointer is to disconnect all signals with that object as a receiver. We want to disconnect all signals with that object as a sender, which is done most easily by passing no explicit arguments. Task-number: QTBUG-62667 Change-Id: I3dd9c5aced9160510bff527355ecfbedded690aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | Use multi-arg instead of multiple arg callsAndré Klitzing2017-10-091-1/+1
| |/ | | | | | | | | | | Change-Id: Ic1f4b357138457eb33ac9154a280f499664c3c78 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* / Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-4/+4
|/ | | | | Change-Id: I0988a4119b5bd790d286c16b5647d97d4d95aef0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace comment with Q_FALLTHROUGHJesus Fernandez2017-05-041-3/+3
| | | | | Change-Id: Ie970ce470672f1c849470b0eaf7fe39758341e37 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-211-10/+6
|\ | | | | | | | | | | | | Conflicts: src/websockets/qwebsocket_p.cpp Change-Id: Ib6b9655985246c9ce3968f1eb662be457465a937
| * Eradicate Q_FOREACH and Java-style loops and mark the module as Q_FOREACH-freeMarc Mutz2016-09-071-11/+8
| | | | | | | | | | | | Change-Id: I200f72423f13b54c636e995b120a70968b0e0758 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Eradicate Q_FOREACH loopsAndré Klitzing2016-08-231-1/+2
|/ | | | | Change-Id: I08541a4162ceb4ba101ed44d65143dda6eb84e3d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-021-1/+1
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I593c47e7aeebb7997f42a7408a8d22704d2713a1
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-1/+1
| |\ | | | | | | | | | Change-Id: Ie37e1ec038e82c845066f92e5f87e355d627e2ff