summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for TLS PSK (client and server)André Klitzing2016-06-121-0/+22
| | | | | | | [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.6' into 5.7v5.7.0-beta1Liang Qi2016-04-081-8/+8
|\ | | | | | | Change-Id: I7ebcdc16a8b65103abfb9640c990eddbeccdef05
| * Doc: Add external-resources.qdocKai Koehne2016-04-071-8/+8
| | | | | | | | | | | | | | | | | | Also sanitize some linking, e.g. by referencing to the paper by title, not by link. Change-Id: I95482994ca569001a23a3beb0e3cbe6739f4ed77 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@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-0/+2
|\ | | | | | | | | | | | | Conflicts: tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp Change-Id: Ie4184b0788b6a0a5a85ca8e4d1547c33f7027ca0
| * Set parent of internal socket objectsPeter Kümmel2015-09-041-0/+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-0/+2
| | | | | | | | | | | | Task-number: QTBUG-40842 Change-Id: I02787a0e55701966e564a312d51297f4160bd89a Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Add open(const QNetworkRequest &) and request()Luca Niccoli2015-04-081-2/+25
|/ | | | | | | | | | | 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>
* Improve the integration of QtWebsockets into general Qt docsv5.4.0-beta1Alex Blasche2014-09-281-0/+1
| | | | | | | | | | | | | 1.) The websocket qml types page is now hooked into Qt's QML Type by Module page. 2.) Correct incorrectly documented import statement for Qt.WebSockets module in QML. 3.) Add missing \since tags (see QTBUG-36775). Change-Id: I1321db70215fcd16cfbd77dd71a459244241d8a3 Reviewed-by: Jerome Pasion <jerome.pasion@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>
* Use the proper protocol namesSze Howe Koh2014-04-091-8/+8
| | | | | | | | - "WebSocket" is one word, with uppercase 'W' and 'S'. - "HTTP"/"HTTPS" is fully uppercase Change-Id: Ice3a50c94394433c97f7347291af5cda69b234ce Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Doc: Language/writ. guidelines review Qt WebSocketsNico Vertriest2014-03-141-7/+7
| | | | | | | Task-number: QTBUG-37149 Change-Id: Ic0c28928404fc515de40e6fdff11849cdb2929d6 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update documentation.Kurt Pattyn2014-03-111-0/+4
| | | | | Change-Id: I8fca0df0ea66adba0898d95f8249ea1b7f33892a 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/+31
| | | | | | | | | 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>
* Check on newline characters in origin and urlsKurt Pattyn2014-02-111-0/+5
| | | | | | | | | | New line characters (\r\n) in the resource part of a url and in the origin string can be used to forge the http header and can lead to insertion of unwanted header entries. This can be an indication of an attack, so QWebSocket immediately refuses a connection. Change-Id: I9cdb309bfbe7025ad675925e6ea3e038476a1fd6 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Sanitize open() methodKurt Pattyn2014-02-071-5/+2
| | | | | | | | | Removed the mask parameter because a web socket client does not have a choice between masking and not masking. Change-Id: I3c33acc235bb2a99476abb6201e6dbb6f881dd70 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Do not access QObject API before its private data is initialized.Milian Wolff2014-02-061-0/+4
| | | | | | | | | | | | Inside the ctor of the private data, the QObject has not yet been associated with the data. Thus, accessing it indirectly i.e. to setup private signal/slot connections, will trigger crashes. Now we delay accessing this API and call an init() function manually in the parent QObject-inheriting class. Change-Id: I2c3ce7335c54d42af6bce87de867ee0ef197efc6 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Use QObjectPrivate instead of dedicated d-ptrKurt Pattyn2014-02-051-5/+2
| | | | | Change-Id: I3f69a2b0ca81e1e003200bb8e0a337b9532e64a0 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Adapt isValid to only return true when socket is in connected stateKurt Pattyn2014-02-011-1/+2
| | | | | | | | Changed isValid() to only return true when the socket is also in connected state. Also updated the documentation. Change-Id: Id80dbc1f28c82bef19984c5ed7b34a7d474ee011 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove socketOption functionalityKurt Pattyn2014-02-011-20/+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>
* Update documentationKurt Pattyn2014-02-011-0/+6
| | | | | | | | Clarified which versions are supported and that subprotocols and extensions are not supported. Fixed some typos. Change-Id: I99ef2fbbf74c287bea7d1b7a07881bf0542135ff Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Removed unsupported functionalityKurt Pattyn2014-02-011-18/+0
| | | | | | | | | | Removed subprotocol and extension getter functionality, as this is currently not supported by QtWebSockets. I left the backend implementation intact (in the _p files), for future reference. Change-Id: Ia00739f6f225cd557ceb10b40c83fc81d98aae0b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Rename write methodsKurt Pattyn2014-01-201-4/+8
| | | | | | | | | 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-33/+0
| | | | | Change-Id: Ida5c46e3e42685f5e78f2aee657d12af62286810 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Fix docs after adding const refsFrederik Gladhorn2014-01-171-5/+5
| | | | | Change-Id: I9fc1d996584c1136efca4412fe76c570cc4201ec Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove doc reference to non-existent functionLaszlo Agocs2014-01-171-1/+0
| | | | | Change-Id: I309104e808cd6749d8f9430fcbcf170c78056730 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Limit line length to 100 characters.Kurt Pattyn2014-01-121-44/+86
| | | | | Change-Id: I9da963570b174b9a5a33e65cf144402677b4bab5 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove waitXXX() methods from websocketsKurt Pattyn2014-01-111-38/+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 clarification in documentationKurt Pattyn2014-01-041-0/+5
| | | | | Change-Id: Ib616c4c932cb2797036d2d821af7726fcfe2f877 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add limitation to write() methodsKurt Pattyn2013-12-271-6/+18
| | | | | Change-Id: I5e1176711885ff698b9c05034785adc9a0612ccc Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add extra documentationKurt Pattyn2013-12-221-5/+5
| | | | | Change-Id: I1a3c0571faeabf2d05bc144628d186e5ff039014 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Cleanup code to comply with Qt styleKurt Pattyn2013-12-101-4/+0
| | | | | | | | | | | | | | - 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>
* Add close code and close reason getter functionsKurt Pattyn2013-11-171-0/+20
| | | | | Change-Id: I4eeab1521054e4f4921d25c6a990eeb7486443cb Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Sanitize include directivesKurt Pattyn2013-11-061-5/+6
| | | | | Change-Id: I510e5e8f263d3ea08dd3d623b054d06b2911c6d6 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>
* Refine doc generationKurt Pattyn2013-11-011-5/+44
| | | | | Change-Id: I9da90086c63b88a5664f241da2fa9687c3882ddf Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add functionality to ignore ssl errorsKurt Pattyn2013-11-011-1/+54
| | | | | Change-Id: I81248b9af104c0b3d37c9cfcef250a102f4b1d32 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Implement of secure web socketsKurt Pattyn2013-10-311-0/+10
| | | | | 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-1/+0
| | | | | Change-Id: I4a71909134032d10b398ede74c431964bce7d675 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Adapted documentatonKurt Pattyn2013-10-051-1/+1
| | | | | Change-Id: I6ffcc86b9bbc6efe27b7005a3df6f62f0d1a9293 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Removed unused constant declarationKurt Pattyn2013-09-291-2/+0
| | | | | Change-Id: Iee07585470404281daae768c2db745b65b036dba Reviewed-by: Steven Ceuppens <steven.ceuppens@icloud.com>
* Changes to integrate the websocket module as a full Qt Add-On moduleSteven Ceuppens2013-09-281-0/+592
- 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>