summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Move Q_REQUIRED_RESULT to the beginning of the declarationThiago Macieira2017-04-271-7/+8
| | | | | | | That's the correct place and works with C++11 attributes. Change-Id: I7814054a102a407d876ffffd14b6a2fed3744b03 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Eradicate Q_FOREACH and Java-style loops and mark the module as Q_FOREACH-freeMarc Mutz2016-09-071-1/+1
| | | | | | Change-Id: I200f72423f13b54c636e995b120a70968b0e0758 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1Liang Qi2016-04-081-0/+1
|\ | | | | | | Change-Id: I7ebcdc16a8b65103abfb9640c990eddbeccdef05
| * Update the QWebSocket's QSslConfiguration when neededAndy Shaw2016-03-101-0/+1
| | | | | | | | | | | | | | | | 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>
* | 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-1/+2
|\ | | | | | | | | | | | | Conflicts: tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp Change-Id: Ie4184b0788b6a0a5a85ca8e4d1547c33f7027ca0
| * Set parent of internal socket objectsPeter Kümmel2015-09-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Send and parse headers for the handshake requestLuca Niccoli2015-05-261-1/+2
| | | | | | | | | | | | 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-0/+2
|\ \ | |/ | | | | | | | | | | 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/+2
| |\ | | | | | | | | | Change-Id: I29f5a2acb7ba0313d9e2ac2c005a988d208b617e
| | * Fixed a crash when destroying the QWebSocketServerv5.4.25.4.2Kimmo Karvinen2015-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Add open(const QNetworkRequest &) and request()Luca Niccoli2015-04-081-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | 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>
* | 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>
* | Make the websocket handshake statefullAllan Sandfeld Jensen2014-11-191-0/+13
|/ | | | | | | | | | | 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>
* 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>
* fix typo in macroMaurice Kalinowski2014-03-171-1/+1
| | | | | | Change-Id: Ib302db81e0667d0c89c1da8611639db0811ff9f3 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Adapt copyright headerKurt Pattyn2014-02-151-1/+1
| | | | | Change-Id: I9773492d3673d8aabdb4dd178be6af12eca7ba74 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add user configurable mask generationKurt Pattyn2014-02-151-1/+7
| | | | | | | | | Created a QMaskGenerator abstract base class to serve as a basis for user specific mask generators. Added the possibility to override the default mask generation in QWebSocket. Change-Id: Iaa02b44193f854d103b5f352617789175fe61f89 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Use QObjectPrivate instead of dedicated d-ptrKurt Pattyn2014-02-051-20/+14
| | | | | Change-Id: I3f69a2b0ca81e1e003200bb8e0a337b9532e64a0 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove superfluous Q_REQUIRED_RESULTKurt Pattyn2014-02-041-2/+2
| | | | | | Change-Id: Ie4e01a82082c45918b55e8588c7322dd359ba8c1 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Locally cache read buffer size and pause modeKurt Pattyn2014-02-011-0/+2
| | | | | | | | | When calling setReadBufferSize() and setPauseMode(), the internal socket is not yet created. So we cache these values and apply them when the internal socket is created. Change-Id: I4299232342438c7a6c52fa8ea4a95461b3f85ebf Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Remove socketOption functionalityKurt Pattyn2014-02-011-2/+0
| | | | | | | | | | Removed the setSocketOption() and socketOption(0 methods as they are not really relevant for web sockets. Also, internally for the underlying real socket the LowDelayOption and KeepAliveOption are already set. If ever needed, these methods can be added later. Change-Id: Ibfa279990c5277970eaa2dbc2dd3a7d0cce7154e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Rename write methodsKurt Pattyn2014-01-201-2/+2
| | | | | | | | | Renamed the write methods to sendTextMessage and sendBinaryMessage respectively. This makes the code more readable. Change-Id: Ie49abf07a37f54c84bd01c5c788d2e42b28bcfdd Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove dubious functionsKurt Pattyn2014-01-201-2/+0
| | | | | Change-Id: Ida5c46e3e42685f5e78f2aee657d12af62286810 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add a few more const refsFrederik Gladhorn2014-01-181-3/+3
| | | | | | | | | In case of processPing we need to make a copy that potentially detaches when masking is requested, but pings are < 125 bytes. Before this code would copy the byte array in the same way much earlier. Change-Id: If0592bb4b508eeb11fdbf05c4bb98b9679ed0549 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Make sure that the random generator is initialized in all code pathsFrederik Gladhorn2014-01-171-0/+1
| | | | | Change-Id: Ice4826e7670cffa791250a95387ac1121ddc4089 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Limit line length to 100 characters.Kurt Pattyn2014-01-121-2/+4
| | | | | Change-Id: I9da963570b174b9a5a33e65cf144402677b4bab5 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove waitXXX() methods from websocketsKurt Pattyn2014-01-111-3/+0
| | | | | | | | | | | | | The QWebSocketServer::waitForNewConnection() was just calling QTcpServer::waitForNewConnection(), which was not correct because a connection is only complete when the handshake succeeds. Waiting for the handshake to complete would need a separate thread for the handshake handling code, which would complicate the code a lot. It was decided to leave out all waitXXX() methods from the module, as it is easier to add this functionality later, then to remove it. Change-Id: I778bae45b67f81e151ad2362f772c75e9f537ff0 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add optimizationsKurt Pattyn2013-12-231-9/+9
| | | | | Change-Id: Icd293f832e2d7a6272d4953c1994065d16222375 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Cleanup code to comply with Qt styleKurt Pattyn2013-12-101-3/+4
| | | | | | | | | | | | | | - Correct placement of curly braces - Remove commented-out code - Remove superfluous qDebug statements - Add missing QT_BEGIN_NAMESPACE declarations - Add move semantics - Add cleanup handling to QWebSocketServerPrivate - Add error handling to handshake response, QWebSocketServerPrivate, QWebSocketServer, dataprocessor Change-Id: I0690dc2c444fd6fc0db974d1459bf41bd8c31d40 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Change open method so that a web socket can be reopenedKurt Pattyn2013-11-181-1/+1
| | | | | Change-Id: I1c7059a8e581ce5179c00f187b03f59fbed63ba6 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add close code and close reason getter functionsKurt Pattyn2013-11-171-0/+4
| | | | | Change-Id: I4eeab1521054e4f4921d25c6a990eeb7486443cb Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add QWebSocketConfiguration to pre-cache socket settingsKurt Pattyn2013-11-041-11/+26
| | | | | Change-Id: Ibff22b277b89379dc31b0b7a8a02547e12bff58e Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add correct license headersKurt Pattyn2013-11-011-18/+40
| | | | | Change-Id: I789cd780697aedbca7a90a5991df00b2c7e9ec98 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add functionality to ignore ssl errorsKurt Pattyn2013-11-011-0/+5
| | | | | Change-Id: I81248b9af104c0b3d37c9cfcef250a102f4b1d32 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Implement of secure web socketsKurt Pattyn2013-10-311-0/+14
| | | | | Change-Id: I1f96d5e4e327eae211fd6b458168e1f7607e2dcf Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* make use of the new Q_NULLPTR keyword & shorten if(ptr) conditionsSteven Ceuppens2013-10-111-3/+3
| | | | | Change-Id: I4a71909134032d10b398ede74c431964bce7d675 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* update _global file, to match Qt defaultSteven Ceuppens2013-09-291-1/+0
| | | | | Change-Id: I4bbf6bd60abd93bd18947b8d2a9d42784aaea10b Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* removed unused includesSteven Ceuppens2013-09-291-1/+1
| | | | | Change-Id: I7b934942c77b1da566acf77dc46521975c3ecba4 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* whitesapce updatesSteven Ceuppens2013-09-291-1/+1
| | | | | Change-Id: I3e7feb9123868c558e5500c2142774df54afdfc6 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* update class & filenamesSteven Ceuppens2013-09-291-9/+8
| | | | | Change-Id: Idd2caa074f2f3feba99714bf6927ca879809ad47 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Changes to integrate the websocket module as a full Qt Add-On moduleSteven Ceuppens2013-09-281-0/+183
- Changed project files to use Qt structure - Moved existing sources into subdirectory, to make room for moduels - Created a "import/qmlwebsocket" module skeleton (works, but needs to be extended) - Modified examples to not use "include(.pri)", but use "QT += websocket" - Added qml example skeleton (works, but no useful functionality yet) Project can be build with: $ qmake $ make $ make install Module can be used in other projects with QT += websockets Change-Id: I2123026958b264670dbf8a978dee76edf5855806 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>