summaryrefslogtreecommitdiff
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Test: stablize tst_QWebSocket::tst_moveToThread()5.5Liang Qi2015-10-201-1/+1
| | | | | | | | | | For e8335d48, the test is flaky, but old CI treated it as a PASS. Task-number: QTBUG-48843 Change-Id: I4d2c0d270824d7b1e954e9174493fba2c1c5433f Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Fix DoS vulnerabilityv5.5.15.5.1Kurt Pattyn2015-09-062-5/+73
| | | | | | | | | Add checks on maximum header line length and on the maximum number of header lines. Task-number: QTBUG-48123 Change-Id: I65dbeb53af7aa0dfa137ce31fc2549940559314e Reviewed-by: Richard J. Moore <rich@kde.org>
* Set parent of internal socket objectsPeter Kümmel2015-09-041-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* WebSocketServer: use int type for portLiang Qi2015-07-221-0/+1
| | | | | | | | | | | QML engine doesn't support quint16 as a QML type. Task-number: QTBUG-46790 Change-Id: I5b01dc06a3256dd41affc035fc507082e1935cc8 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Luca Niccoli <lultimouomo@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* tests: enable cmake in auto testsLiang Qi2015-05-221-1/+1
| | | | | Change-Id: Idbfbaa86675381110f35118baf16cac891976707 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix qmldir for qmlwebsockets_compatLiang Qi2015-05-228-0/+199
| | | | | | | | | It is not supported to have both "import Qt.WebSockets 1.0" and "import QtWebSockets 1.0" in the same project. Task-number: QTBUG-46205 Change-Id: I71b824b091f4491b8ab5e1eae8290a51159b03e2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* tests: move all auto tests to websockets sub directoryLiang Qi2015-05-2220-14/+17
| | | | | | | cmake is not included. Change-Id: I9ab6244d8b6b3752f26070b0b15ae70c0cab6d82 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5v5.5.0-beta1Liang Qi2015-04-151-0/+34
|\ | | | | | | Change-Id: I29f5a2acb7ba0313d9e2ac2c005a988d208b617e
| * Fixed a crash when destroying the QWebSocketServerv5.4.25.4.2Kimmo Karvinen2015-04-081-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | 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-1/+12
| | | | | | | | | | | | | | | | 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-0/+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>
* | Enable websocket tests on WindowsLuca Niccoli2015-03-131-8/+2
| | | | | | | | | | | | | | | | | | | | | | The listening socket must be opened on the loopback interface, otherwise the test client won't be able to connect. Also, name resolution can take a lot of time to fail, so we must wait longer when trying to connect to a non-existing host. Change-Id: I6d6744bc89e6e851cf49db5ae2c19aa652c0a8a4 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Frederik Gladhorn2015-02-241-0/+22
|\ \
| * \ Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-201-0/+22
| |\ \ | | |/ | | | | | | Change-Id: I96657102802860c8490c162462324e661592d879
| | * fix the port in Host field in handshake requestLiang Qi2015-02-201-0/+22
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-39355 Change-Id: I06993193fe9618ace93552aed573a3eee5de18fa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* | | Update copyright headersJani Heikkinen2015-02-169-69/+61
|/ / | | | | | | | | | | | | | | | | | | 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-02-131-9/+5
|\ \ | |/ | | | | Change-Id: Ie23422945b48b33a0608053c5f18700fd8133df5
| * Use old-style SIGNAL and SLOT macros in tst_qwebsocket.cppDmitry Shachnev2015-01-261-9/+5
| | | | | | | | | | | | | | | | | | | | | | Without that, this test is failing on some architectures. Task-number: QTBUG-43804 Done-with: Helge Deller <deller@gmx.de> Change-Id: I7d275ca6d0baa70e504bbb4a31c65c2ed65d2118 Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-191-0/+5
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6ceee770359e72a026575ea9fee51c3f97561163
| * QWebSocket should remember close code and reasonv5.4.15.4.1Frederik Gladhorn2014-12-291-0/+5
| | | | | | | | | | | | 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-213-0/+135
|\ \ | |/ | | | | Change-Id: Ifc23e46ef1623cfba93571ff03c6c62a3b2fd117
| * Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-11-033-0/+135
| |\ | | | | | | | | | Change-Id: I0e89ede5ea173f2e831c42d250ddb2b21b42b89b
| | * Fix invalid Date header field in handshake response5.3Joni Poikelin2014-11-033-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix invalid Date header in handshake response on systems with non- english system locale. Task-number: QTBUG-40866 Change-Id: If6d5cc55e879eff259698e87c9cda753990245e7 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
| | * Compile fix without proxy supportMaurice Kalinowski2014-11-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is required for for the autotests to compile. Change-Id: I8cd1ad11ca5d28e2d1ade06649cf6c2e1eee9a2c Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> (cherry picked from commit aef4cba4ce5f3acfa6765c71283d9363dffe97b7)
* | | Fix QWebSocket's handling of query parameters with encoded charactersJuha Turunen2014-10-111-2/+5
|/ / | | | | | | | | | | | | | | | | 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>
* | Fix QWebSocketServer for clients preferring lowercase http headers.Jorma Tähtinen2014-09-091-5/+5
| | | | | | | | | | | | | | | | | | QWebSocketServer should not use case-sensitive compare to validate http headers for incoming connections. Change-Id: Ie7b8a9f6ca1a0b547eb7a924f6392395f812b0e3 Task-number: QTBUG-40615 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Update license headers and add new license filesv5.4.0-alpha1Antti Kokko2014-08-248-144/+80
| | | | | | | | | | | | | | - Added LICENSE.LGPLv3, LICENSE.GPLv2 & LICENSE.LGPLv21 Change-Id: I0586e35a7aa99be1b5b3bda580b05897f451acbf Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* | Compile fix without proxy supportMaurice Kalinowski2014-07-071-0/+4
| | | | | | | | | | Change-Id: I8cd1ad11ca5d28e2d1ade06649cf6c2e1eee9a2c Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-06-261-0/+18
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Idce64ab613c4e07ffb38cac4115690b885f110f2
| * Fix a typo in proxy handling.Jędrzej Nowacki2014-06-251-0/+18
| | | | | | | | | | | | Change-Id: I25c9b9be2c780dae32e3f634f58e44be303a4b23 Task-number: QTBUG-39568 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* | Add a QUrl serverUrl method to QWebSocketServer.Milian Wolff2014-06-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-04-111-3/+3
|\ \ | |/ | | | | Change-Id: Iff68a7da2065b64579032f1be8eaf5fb097d58bb
| * Use the proper protocol namesSze Howe Koh2014-04-091-3/+3
| | | | | | | | | | | | | | | | - "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>
* | Remove unused variableKurt Pattyn2014-03-181-1/+0
|/ | | | | Change-Id: I534878275ea39a28f684c3edac414d647743da69 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix unit testsKurt Pattyn2014-03-121-1/+1
| | | | | Change-Id: I24091b8b976b30e8d6ef26f41530027339106243 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Return correct error string for known socket errorsKurt Pattyn2014-03-121-6/+36
| | | | | | Task-number: QTBUG-37228 Change-Id: I246b858694ea456bce9a0fc4ac963a83502fd058 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Prefer to use normalised signal/slot signaturesSergio Ahumada2014-03-011-4/+4
| | | | | | Change-Id: I92322fc3404795bea8442b9b849564d5cd39b367 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Rename websockets.pro -> qtwebsockets.proSergio Ahumada2014-02-163-6/+17
| | | | | Change-Id: Ia42316304a37d151b678a9922071bbb090ec87b5 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Adapt copyright headerKurt Pattyn2014-02-158-8/+8
| | | | | Change-Id: I9773492d3673d8aabdb4dd178be6af12eca7ba74 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add user configurable mask generationKurt Pattyn2014-02-153-1/+174
| | | | | | | | | 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>
* Fix multiple emission of received signalsKurt Pattyn2014-02-151-0/+216
| | | | | | Task-number: QTBUG-36762 Change-Id: I239bdd06252fb90056a687ace8540bb91b0055a1 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Check on newline characters in origin and urlsKurt Pattyn2014-02-111-5/+107
| | | | | | | | | | 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>
* Remove superfluous argumentKurt Pattyn2014-02-091-1/+1
| | | | | Change-Id: I7fa01d47d66411572f3f66f4ed5d8df04ac6b8b0 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Fix tst_QWebSocket::tst_invalidOpen for catch-all DNS setups.Milian Wolff2014-02-061-5/+5
| | | | | | | | | | | | Instead of relying on a hostname which might still be resolved in some DNS setups (i.e. always forward to google search or intranet), we now try to connect to localhost port 1 which should yield a ConnectionRefusedError. This way, the test passes for me on my setup. Change-Id: I025824796e94e718a42c4999706f647a72b37659 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Fix compilation of websocketprotocol test.Milian Wolff2014-02-061-0/+1
| | | | | | | | The versionFromString method must be exported for usage in the test. Additionally, the metatype of the version enum must be declared. Change-Id: I8e0aef28f9902f274cab43f772667ad5a93c4062 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add unit tests for QWebSocketServerKurt Pattyn2014-02-023-1/+374
| | | | | Change-Id: I9ca38aad22a757437943a72669b7ca2bb5db6b98 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add unit tests for QWebSocketKurt Pattyn2014-02-023-0/+242
| | | | | | | Added basic unit tests for QWebSocket. Connectivity is not tested yet. Change-Id: I38d388d289733777e6ff0253e5b201aca99b0b10 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Move versionFromString() from public to private APIKurt Pattyn2014-02-011-1/+76
| | | | | | | | This method is only necessary for processing of handshakes and hence is not needed in the public API. Change-Id: I6bb2327337600523a136fb394275c31b9819f631 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Move CORS authenticator test to non-private testsKurt Pattyn2014-02-014-34/+26
| | | | | | | | QWebSocketCorsAuthenticator is a public class and hence needs to be tested with the public API of QtWebSockets. Change-Id: If3af0744d8901f9c6c13d5fb9061ebf0a5a8d163 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Use QStringLiteral where appropriateKurt Pattyn2014-01-203-3/+3
| | | | | Change-Id: I608b555428aceafd7761a882cd4bd1fdb50d19b3 Reviewed-by: Richard J. Moore <rich@kde.org>