summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | 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 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
| | * Fixed erroneous detection of server disconnect conditionOleksandr Tymoshenko2016-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractSocket::atEnd does not check actual connection state it only checks if data is ready to be read. Under some conditions (e.g. slow network) data may not be available yet but it doesn't mean the server dropped connection. When more data comes FSM will pick it up and handle as expected. The right way to check disconnect is to check for actual socket state. Task-number: QTBUG-51069 Change-Id: I17d7110fbefdba2d5378a71935ab5923f8c1bf3e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add support for TLS PSK (client and server)André Klitzing2016-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | [ChangeLog][QWebSocket] It is now possible to use TLS PSK ciphersuites. Change-Id: I9e96669494cec5e6a4e076fe9f10fcd4ef6358a4 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-04-081-2/+24
|\ \ \ | |/ / | | | | | | Change-Id: I8a2d6875b68c99786f99ec0dc380f8725c6abd42
| * | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1Liang Qi2016-04-081-2/+24
| |\ \ | | |/ | | | | | | Change-Id: I7ebcdc16a8b65103abfb9640c990eddbeccdef05
| | * Fix possible hang on handshakeKai Koehne2016-04-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | processHandShake operates on complete lines. If the data available does not contain the full handshake message, the loop will therefore never return. Task-number: QTBUG-51001 Change-Id: Ie87f5b5dee01116f463e84f06feab502ff5ac563 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Update the QWebSocket's QSslConfiguration when neededAndy Shaw2016-03-101-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This ensures that the peer certificate chain is kept in sync so that it can be queried when an encrypted connection has been made. Change-Id: I5df18bb71ac4bec3a8a939482df5a5ffe5c20cb5 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | | Remove unused variableFrank Meerkoetter2016-04-071-3/+1
| | | | | | | | | | | | | | | Change-Id: I0ffeb96bfab3543f94501bf1605bb6c899ef466f Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Limit variable scopeFrank Meerkoetter2016-04-071-2/+1
| | | | | | | | | | | | | | | Change-Id: I8930d132cfcf09edeaa30bb052d9ea0a5ee47a98 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Limit function visibility to the translation unitFrank Meerkoetter2016-04-071-1/+1
|/ / | | | | | | | | | | | | Do not create a global symbol. Change-Id: I176c0b4441815e5c6ca02b89b1fe0dd5a1bcdb2f Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-201-14/+20
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I8c17da1f7e2f0a620e3627fa7f8087f185545c8a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-18/+25
|\ | | | | | | | | | | | | Conflicts: tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp Change-Id: Ie4184b0788b6a0a5a85ca8e4d1547c33f7027ca0
| * Set parent of internal socket objectsPeter Kümmel2015-09-041-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After moving the websocket into another thread current code doesn't work because then the QTcpSocket/QSslSocket objects reside in a different thread, for instance: "QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread" QObject::moveToThread(QThread*) also moves QObjects's children, therefore their internal socket objects need to be children of QWebSocket. QWebSocket has ownership of the internal socket, and the smart pointer is not needed any more. Change of cleanup code to prevent crashes with clang/msvc builds: QWebSocketPrivate is a scoped member of QObject (not QWebSocket) and is destroyed after QObject destructor body was executed, and so m_pSocket&co had already been destroyed (being children) when the destructor of QWebSocketPrivate is called via the scoped pointer. Analogous to 64927e04f202d33b9a9a1f94141ef692c0b513ac Change-Id: I1ade6cda3fa793c30332cc5e103025e2dda3c78c Reviewed-by: Luca Niccoli <lultimouomo@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-301-1/+5
|\ \ | |/ | | | | | | | | | | | | Conflicts: .qmake.conf src/websockets/qwebsocket_p.cpp Change-Id: Ibcc1898263cc8bc80066370f045df6a217e46574
| * Correct the default port of secure hand shake requestLiang Qi2015-05-221-1/+5
| | | | | | | | | | | | | | | | Task-number: QTBUG-46055 Change-Id: Iefdec32f778d39520802eabb25f4db37f80fdf76 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Luca Niccoli <lultimouomo@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Send and parse headers for the handshake requestLuca Niccoli2015-05-261-2/+21
| | | | | | | | | | | | Task-number: QTBUG-40842 Change-Id: I02787a0e55701966e564a312d51297f4160bd89a Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-05-111-3/+16
|\ \ | |/ | | | | | | | | | | Conflicts: src/websockets/qwebsocket_p.cpp Change-Id: Ia6434b282b4a0ee92e2b2a8664389f325bd0fcb0
| * Merge remote-tracking branch 'origin/5.4' into 5.5v5.5.0-beta1Liang Qi2015-04-151-0/+11
| |\ | | | | | | | | | Change-Id: I29f5a2acb7ba0313d9e2ac2c005a988d208b617e
| | * Fixed a crash when destroying the QWebSocketServerv5.4.25.4.2Kimmo Karvinen2015-04-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifetime of incoming QTcpSocket/QSslSocket are managed by the QTcpServer/QSslServer and thus the QWebSocketPrivate should clear the pointer to the socket when the socket is destroyed. Added auto test for the crash. Task-number: QTBUG-45331 Change-Id: I6e30e7cdcca22aa810ccc1a1d4d7d77c7cb2c349 Reviewed-by: Steven Ceuppens <steven.ceuppens@icloud.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * | Do not decode the HTTP resource nameLuca Niccoli2015-04-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | The resource needs to be sent encoded in the HTTP request. Task-number: QTBUG-44889 Change-Id: I3c6c56f5fea1553f3b5751de7da0cfc76150f4b9 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * | Always initialize m_handshakeStateLuca Niccoli2015-04-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The client-side constructor was leaving it uninitialized, which would sometimes lead to spurious error signals being emitted. Task-number: QTBUG-44893 Change-Id: I7a17f1a16d9a5fe4218beb6d92993c1889ad836b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | | Add open(const QNetworkRequest &) and request()Luca Niccoli2015-04-081-13/+15
|/ / | | | | | | | | | | | | | | | | | | | | Request headers are not yet handled, only the QNetworkRequest::url() is taken into consideration. [ChangeLog][QWebSocket] Added open(const QNetworkRequest &) and request() Task-number: QTBUG-40842 Change-Id: Ia2e10f22c79b0a085afb9a2eb8437b7a73d4a045 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-251-1/+6
|\ \ | |/ | | | | Change-Id: I218b5069480f60b88390c8540f01c3dbbee485d0
| * client ping should be maskedLiang Qi2015-02-241-1/+6
| | | | | | | | | | | | | | | | Task-number: QTBUG-42298 Change-Id: I4c01052823ce48b737d30ac2e0ef11836124bc4f Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Neil Williams Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-161-6/+6
| | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I8467410bfad44e8d3fe6bd5724c61bb0c07c91f9 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-191-0/+2
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6ceee770359e72a026575ea9fee51c3f97561163
| * QWebSocket should remember close code and reasonv5.4.15.4.1Frederik Gladhorn2014-12-291-0/+2
| | | | | | | | | | | | Task-number: QTBUG-42982 Change-Id: I50dbff96d7d64a5213e6ea6ba7bb9429b21b1fb2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-211-9/+16
|\ \ | |/ | | | | Change-Id: Ifc23e46ef1623cfba93571ff03c6c62a3b2fd117
| * Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-11-031-9/+16
| |\ | | | | | | | | | Change-Id: I0e89ede5ea173f2e831c42d250ddb2b21b42b89b
| | * Make QWebSocketPrivate::makeConnections() take care of all connections.Christian Kandeler2014-11-031-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise all code that calls it has to handle the other connections separately, which is error-prone and has actually been forgotten for the case where the QWebSocket is created via upgradeFrom(). Task-number: QTBUG-39551 Change-Id: I4d1e4faa1594b53e7a8dccc9ce13ef2c323b1c61 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* | | Make the websocket handshake statefullAllan Sandfeld Jensen2014-11-191-39/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The websocket handshake could not handle being split over multiple TCP packets since it was entirely handled in on function. This patch splits it into a socket state making it possible to process over multiple incoming packaets. Change-Id: I3c45892ee6f1bb67062d561e9fbd2d7296f1208e Task-number: QTBUG-40878 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* | | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-201-0/+1
|\ \ \ | |/ / | | | | | | Change-Id: I587edb09f88db76917755593bfe0cbb5c460ce96
| * | Also forward the bytesWritten(qint64) signalPeter Kümmel2014-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The signal bytesWritten(qint64) is part of the public API and should be emitted. Seems it was just forgotten. Change-Id: I85a56c22581c6bd3ecc504add34aeeabc76f4d2a Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* | | Fix QWebSocket's handling of query parameters with encoded charactersJuha Turunen2014-10-111-1/+1
|/ / | | | | | | | | | | | | | | | | QWebSocket used decoded version of the query part of the URL to construct the first line of the HTTP request. Task-number: QTBUG-41285 Change-Id: If16210f1b92e389dae8b1057a2d911122c31e2db Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Update license headers and add new license filesv5.4.0-alpha1Antti Kokko2014-08-241-18/+10
| | | | | | | | | | | | | | - Added LICENSE.LGPLv3, LICENSE.GPLv2 & LICENSE.LGPLv21 Change-Id: I0586e35a7aa99be1b5b3bda580b05897f451acbf Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-06-261-1/+1
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Idce64ab613c4e07ffb38cac4115690b885f110f2
| * Fix a typo in proxy handling.Jędrzej Nowacki2014-06-251-1/+1
| | | | | | | | | | | | Change-Id: I25c9b9be2c780dae32e3f634f58e44be303a4b23 Task-number: QTBUG-39568 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* | Copy the more efficient HTTP header parser from QtNetworkThiago Macieira2014-05-091-21/+46
|/ | | | | | | | | | The one from QtNetwork is more efficient, since it doesn't use regular expressions. This also solves a use of uninitialised variables. error: ‘httpStatusCode’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: Id7f203d971564651eb0bd63d3d54d074be947793 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Fix process handshake for servers preferring lowercase http headers.Jędrzej Nowacki2014-04-091-7/+7
| | | | | | Task-number: QTBUG-37975 Change-Id: I81225a870aa92350e959b741aec34332eb8d171e Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>