summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocketserver.h
Commit message (Collapse)AuthorAgeFilesLines
* Add support for chrono versions of handshakeTimeout functionsv5.14.0-beta2Mårten Nordheim2019-10-091-1/+15
| | | | | | | | | | | | | 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>
* websocket server: add timeout to abort incomplete handshakesHeiko Voigt2019-04-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | A websocket connection can involve two types of handshakes. First an optional SSL handshake and second the websocket handshake itself. Either one can get stalled/stuck if the other side does not answer. To be robust by default and for easy mitigation by users of websockets let's introduce a handshake timeout. We introduce a default timeout of 10 seconds which can be customized by the newly introduced setHandshakeTimeout() method. One major location where connections got stuck was when the connection queue was filled with connections waiting for the SSL handshake. Only connections that have finished this handshake can be processed anyway so we now add them to the queue once they are fully ready to start the websocket handshake. Task-number: QTBUG-63312 Task-number: QTBUG-57026 Change-Id: Ia286221f1d8da1000e98973496280fde16ed811d Reviewed-by: Alf Crüger <a.crueger@baxi-innotech.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix implicit conversion warningJesus Fernandez2018-08-201-2/+12
| | | | | | | | | | | | | Marks the old functions as deprecated and adds new safe versions.The new functions give access to the native descriptor safely. It also fixes the original functions in Qt 6. warning: implicit conversion loses integer precision: 'qintptr' (aka 'long long') to 'int' Change-Id: I59177905af0181912d2e7824ce68265cb8ee03d9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use override keywordJesus Fernandez2018-08-101-1/+1
| | | | | Change-Id: I120dcb26eb451930d02e452cc47262eda44cc77c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-111-2/+1
|\ | | | | | | | | | | | | Conflicts: examples/websockets/simplechat/chatserver.cpp Change-Id: I98697cef4c05516b5b4122ad81c084546d57115f
| * Replace Q_ENUMS by Q_ENUMAndré Klitzing2017-10-101-2/+1
| | | | | | | | | | Change-Id: Ie16c88fb0a215efe5f152ea2d12c984f8d9e0878 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-1/+1
|/ | | | | Change-Id: I0988a4119b5bd790d286c16b5647d97d4d95aef0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a function to hand off a tcp socket to the websocket serverAleksey Lysenko2017-01-271-0/+3
| | | | | | | | | | | | | This method allows a listening port to process connections with different protocols. It lets the websocket server handle a TCP socket, upgrading it to a websocket [ChangeLog][QWebSocketServer] Add support to handle external QTcpSocket Done-with: André Klitzing <aklitzing@gmail.com> Task-number: QTBUG-54276 Change-Id: Ia36b481dc87d6f3806e9f1e61e75e528640f1937 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fixed QWebSocketServer::SslMode collisionAleksey Lysenko2016-12-141-2/+2
| | | | | | | | | | | | | | Value of NonSecureMode enumerator depends on QT_NO_SSL. If Qt is built with QT_NO_SSL defined, NonSecureMode is equal to 0, otherwise it is equal to 1. It may lead to problem if user built app with libs where NonSecureMode = 0, but run it with libs where NonSecureMode = 1. [ChangeLog][QWebSocketServer] SslMode::NonSecure enumerator now always has the same value (1) regardless of SSL enabled or disabled. Task-number: QTBUG-56129 Change-Id: If17137eff4b19015697c827a985ef89dd95a5611 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add support for TLS PSK (client and server)André Klitzing2016-06-121-0/+1
| | | | | | | [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.7Liang Qi2016-03-071-1/+1
|\ | | | | | | Change-Id: I57c01d5a8836903352d7edadc4a10972f57399eb
| * Make public headers compile with -Wzero-as-null-pointer-constantMarc Mutz2016-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Change-Id: Id9621ffedaf190f8b97db613a7c6be2a45f117b3 Task-number: QTBUG-45291 Reviewed-by: Lars Knoll <lars.knoll@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>
* 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>
* 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-07-141-1/+1
|\ | | | | | | | | | | | | Conflicts: src/imports/qmlwebsockets/qqmlwebsocket.h Change-Id: Ib883a07eb1784743adca7a0c38fd156800354f4b
| * Use 0 instead of Q_NULLPTR in public headers.v5.3.25.3.2Sergio Martins2014-07-111-1/+1
| | | | | | | | | | | | | | | | Otherwise Q_NULLPTR appears in documentation, which is inconsistent. Change-Id: I0f4b07b25c6012d502938aa452e68c75d910f954 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Add a QUrl serverUrl method to QWebSocketServer.Milian Wolff2014-06-081-0/+1
|/ | | | | | | | | | | | It is useful in many places, esp. when constructing clients that should connect to the server we created. Note that the returned host address will be LocalHost instead of Any, to make sure clients can connect to the server even on Windows. This should hopefully resolve the CI issues. Change-Id: I3c400ad4d785ea398cf1a1bd113c0833fda9e3bd 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>
* Use QObjectPrivate instead of dedicated d-ptrKurt Pattyn2014-02-051-3/+0
| | | | | Change-Id: I3f69a2b0ca81e1e003200bb8e0a337b9532e64a0 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Removed unsupported functionalityKurt Pattyn2014-02-011-2/+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 SecureMode to SslModeKurt Pattyn2014-01-201-6/+6
| | | | | | | | Renamed SecureMode to SslMode to be more inline with QSslSocket. Change-Id: Id2f0c5ebc1e06fcd7b0ce5059e88520e5f0e6fe5 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Rename enumerations to comply with Qt styleKurt Pattyn2014-01-181-2/+2
| | | | | Change-Id: Id72fe27cec606e7f02b8e9ac1d0d763890e86a95 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add reference to related feature reportKurt Pattyn2014-01-181-0/+1
| | | | | Change-Id: Iba4aa2db5a2967865ff731134e6514d6649bcafb Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Limit line length to 100 characters.Kurt Pattyn2014-01-121-1/+2
| | | | | Change-Id: I9da963570b174b9a5a33e65cf144402677b4bab5 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove waitXXX() methods from websocketsKurt Pattyn2014-01-111-1/+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>
* Cleanup code to comply with Qt styleKurt Pattyn2013-12-101-3/+5
| | | | | | | | | | | | | | - 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 sslEchoClient and sslEchoServer examplesKurt Pattyn2013-11-061-3/+28
| | | | | | | Add license headers Change-Id: Ied74cb3db6ceed6c3f361e4afac860a7a3fb7676 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Sanitize include directivesKurt Pattyn2013-11-061-3/+3
| | | | | Change-Id: I510e5e8f263d3ea08dd3d623b054d06b2911c6d6 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add correct license headersKurt Pattyn2013-11-011-20/+42
| | | | | Change-Id: I789cd780697aedbca7a90a5991df00b2c7e9ec98 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove QtWebSockets from include directivesKurt Pattyn2013-10-151-2/+2
| | | | | | | Having QtWebSockets/ in front of the includes, results in a failing Windows build. Change-Id: I3b7f9ee3f1f06d4588a25a02324d1e1f0e4fde81 Reviewed-by: Steven Ceuppens <steven.ceuppens@icloud.com>
* make use of the new Q_NULLPTR keyword & shorten if(ptr) conditionsSteven Ceuppens2013-10-111-1/+1
| | | | | Change-Id: I4a71909134032d10b398ede74c431964bce7d675 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Update to fix minor compiler warningsSteven Ceuppens2013-10-011-2/+3
| | | | | Change-Id: I9b8e4cb5ad174faaf7d8c32a00a0b4b4c66edb68 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* update _global file, to match Qt defaultSteven Ceuppens2013-09-291-1/+1
| | | | | Change-Id: I4bbf6bd60abd93bd18947b8d2a9d42784aaea10b Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* update class & filenamesSteven Ceuppens2013-09-291-4/+4
| | | | | 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/+92
- 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>