summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* wasm: set and update socket stateLorn Potter2019-01-042-1/+5
| | | | | | | Fixes: QTBUG-72664 Change-Id: I8bd90f8676835d8f7bec135ad3e6c6b3e9cd9d9a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: refactor and convert from EM_ASMv5.12.0-beta4v5.12.0-beta3v5.12.0-beta2v5.12.0-beta1Lorn Potter2018-10-012-137/+94
| | | | | | | | | | This also has the benefit that binary data is no longer accessed via a global. Change-Id: I2db744696fe88ca03f55897016d9d38e302f820b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Update plugins.qmltypesKai Koehne2018-09-273-2/+4
| | | | | | | | | | | Add an empty dependencies.json to avoid the implicit QtQuick dependency. Task-number: QTBUG-70264 Change-Id: I67b0f8cee04d3cd255c9df3c9bc7caf79ffdf9a9 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add support for WebSockets on Qt for WASMLorn Potter2018-09-203-0/+245
| | | | | | | | | Implement the QWebSocket API using HTML WebSocket. Change-Id: I2284f8606d512943d2abc2a96fc48effcc45a786 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix implicit conversion warningJesus Fernandez2018-08-202-3/+107
| | | | | | | | | | | | | 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>
* Remove redundant options and a stray defineJesus Fernandez2018-08-172-4/+2
| | | | | Change-Id: Ic7ce11f1631197e6ee019b66c0d7ec56590c5ab5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove unnecesary default labelJesus Fernandez2018-08-141-2/+0
| | | | | | Change-Id: I994b34614b2e2ee95fed145e7f5dcd873ff7c3f4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix conversion warningsJesus Fernandez2018-08-143-10/+14
| | | | | | Change-Id: I087b72412db19f34b8e890ddc6a3a0fcdd434141 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use QObjectPrivate::q_ptr instead of shadowing itJesus Fernandez2018-08-146-37/+25
| | | | | | | | | | Some private classes had a q_ptr pointer shadowing the QObjectPrivate::q_ptr pointer. Q_Q casts the QObjectPrivate::q_ptr pointer to match the public class so there is no need to store a different pointer. Change-Id: I8f5c4323b1dcf45a9796c0dd9f522bdbc63add18 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use nullptr instead of 0Jesus Fernandez2018-08-101-1/+1
| | | | | | Change-Id: Ibad1bbb351d14ab0de140875d2969b7da483eb21 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use override keywordJesus Fernandez2018-08-1011-18/+18
| | | | | Change-Id: I120dcb26eb451930d02e452cc47262eda44cc77c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix C-style castJesus Fernandez2018-08-101-3/+3
| | | | | | Change-Id: I9e2b2ff177aa921f7f86319de4a229c1a8a4c410 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-072-4/+11
|\ | | | | | | Change-Id: Iffe66da51d3b7b38d04ca3c185b3b003b157f886
| * Limit Close frame to 125 bytesMårten Nordheim2018-08-062-4/+11
| | | | | | | | | | | | | | | | | | | | | | All control frames should be limited to 125 frames. https://tools.ietf.org/html/rfc6455#section-5.5 Task-number: QTBUG-62949 Change-Id: Id9b5a431faab6ff6edf7dc2e5c3525e999bc04ea Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Use QUrl::toString() when forming the 'Host' headerTimur Pocheptsov2018-05-161-10/+12
| | | | | | | | | | | | | | | | | | | | This allows to correctly use IPv6 literals and also deals (correctly) with a port (if it's set at all). Task-number: QTBUG-68245 Change-Id: I6d29543887c4ab58d70f0970a6f0a1b822c301df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Remove the code to manually initialize resources in static buildsSimon Hausmann2018-04-271-8/+1
| | | | | | | | | | | | | | | | | | After commit be9a56e5e3ced5d0d668fa24e4c65ae928f2e25a in qtbase, this is not needed anymore. Instead the resource system injects the plugin entry point with a reference to all resources. Change-Id: I09efba67c3d2e9b68b73707101f1b8cc22284131 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-211-2/+0
|\ \ | |/ | | | | Change-Id: If3f9affe2d1768ea9fc741d9be2a749d3baf2153
| * QWebSocket: fix bytesWritten being emitted twiceMårten Nordheim2018-04-181-2/+0
| | | | | | | | | | | | | | | | Because it was connect-ed twice. Task-number: QTBUG-67778 Change-Id: Ia19d2471c148c615faceb7548566d819683c2193 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QWebSocket: Add 'bytesToWrite'Mårten Nordheim2018-04-142-0/+15
|/ | | | | | | | | | | | | | | | Add the well-known 'bytesToWrite' function to QWebSocket. Previously the only way to know how many bytes were left to be written was to make a guesstimate on the overhead your message would get and then keep track of the amount sent using the 'bytesWritten' signal. The tests compare using '>' because there is overhead from the headers. [ChangeLog][QWebSocket] Added the bytesToWrite function to QWebSocket. Call this function to see how many bytes are left to write. Change-Id: I82f17a98b582ee3bc02f0c47597b4a6717761f12 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Add license section to overviewv5.11.0-beta4Kai Koehne2018-04-051-0/+9
| | | | | | Change-Id: I580d2170f76a501dd95c8377d3f480b65a983d53 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Make QWebSocketServer work with Safariv5.11.0-beta3Morten Johan Sørvig2018-03-222-3/+4
| | | | | | | | | | | | | | | | | | | Sending an empty “Server” header during handshake will make Safari error out with “WebSocket connection [...] failed: Invalid UTF-8 sequence in header value” This is an open bug in WebKit: https://bugs.webkit.org/show_bug.cgi?id=139298 As far as I see, “Server” is not a required handshake header as specified in RFC 6455 section 4.2.2 (5), and we can omit it if the server name is not set. Change-Id: Icec142f867813c16e3e3baa1378582164242e049 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Make HTTP header parsing RFC-compliantRobert Griebl2017-11-282-13/+41
| | | | | | | | | | | All this home-grown parsing should be replaced with code from the qhttp* classes. This would result in a big refactoring though, so this commit at least tries to make the header parsing RFC compliant and not choke on perfectly legal "Header:Value" messages. Change-Id: I14303610dc7187b8d8595568fb221c18e4e0d515 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-2010-28/+36
|\ | | | | | | | | | | | | | | Conflicts: src/websockets/qwebsocket_p.cpp tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp Change-Id: I40922fab198a09a3fbba1b2f11b42f2d40e53720
| * Update to new QRandomGenerator APIv5.10.0-beta4Thiago Macieira2017-11-033-6/+6
| | | | | | | | | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-307-22/+30
| |\ | | | | | | | | | 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>
| | * Fix handshakeReceived not being invoked in some situationMårten Nordheim2017-10-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the rare case where the handshake was received before the signal and slot was connected it would never invoke handshakeReceived and the server would keep waiting. Task-number: QTBUG-64026 Change-Id: I86d54031d2583b6a0cf2b5348889b5ef859b9aab Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * Fix outdated FDL license headerKai Koehne2017-10-235-22/+22
| | | | | | | | | | | | | | | Change-Id: Ic41f3745e800ba54153b36f269017075297c2402 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | | Replace typedefs by QOverloadAndré Klitzing2017-10-302-10/+8
| | | | | | | | | | | | | | | | | | Change-Id: I509332fa23bcf2cf2e6c10b7edacb4157f025ff9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Use QStringLiteral to fix clazy-qstring-allocationsAndré Klitzing2017-10-301-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I59bcb929a37096e7c5a14d4003f26267bd0d752a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-114-15/+15
|\ \ \ | |/ / | | | | | | | | | | | | | | | Conflicts: examples/websockets/simplechat/chatserver.cpp Change-Id: I98697cef4c05516b5b4122ad81c084546d57115f
| * | Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta3v5.10.0-beta2Liang Qi2017-10-112-11/+12
| |\ \ | | |/ | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I4af142703e469b56236b73335a93f6960534c0f1
| | * Replace iterator based loop by range-for-loopAndré Klitzing2017-10-101-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Found by clazy and fixes "clazy-strict-iterators" warning. Change-Id: I8f50c92ac054d627499440d593faa43ed5b4ad4b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * 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>
| * | Replace Q_ENUMS by Q_ENUMAndré Klitzing2017-10-102-3/+2
| | | | | | | | | | | | | | | Change-Id: Ie16c88fb0a215efe5f152ea2d12c984f8d9e0878 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | 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 Q_NULLPTR with nullptrKevin Funk2017-09-2611-18/+18
|/ / | | | | | | | | Change-Id: I0988a4119b5bd790d286c16b5647d97d4d95aef0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devv5.10.0-alpha1Liang Qi2017-08-151-11/+0
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I3dd9c568ed9160510bff527355ecfbed5d4690a9
| * Remove workaround for unsupported compilerJake Petroules2017-08-141-11/+0
| | | | | | | | | | | | | | | | | | Qt for WinRT now requires Visual Studio 2015. Change-Id: I8996f2855476315819532df89c6754aa162bd02e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Change the mask generator to use QRandomGenerator instead of qs?randThiago Macieira2017-06-303-12/+12
|/ | | | | | | | | This makes it secure, instead of insecure, and requires no seeding. Task-number: QTBUG-61694 Change-Id: Ia53158e207a94bf49489fffd14c782bd4ec24946 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Replace comment with Q_FALLTHROUGHJesus Fernandez2017-05-041-3/+3
| | | | | Change-Id: Ie970ce470672f1c849470b0eaf7fe39758341e37 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QQmlWebSocket::setUrl(): let open() decided what to actually doEdward Welbourne2017-05-041-3/+1
| | | | | | | | | | | | | | | | After emitting urlChanged(), setUrl() did a manual open(url) if it had a web-socket to do it on, omitting various checks that open() imposes on actually calling open(url); as a result, it left the web socket in an inconsistent state if it wasn't yet active. This meant that setting active could trigger a second open() while the web-socket was already open(), which upset it. Replaced the hand-rolled call to open(url) with a call to open() so as to be consistent and avoid such problems. Task-number: QTBUG-58278 Change-Id: Iee84f2b0d973e7fd288a14018039a665658c0040 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* 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>
* Fix build for -no-feature-textcodecStephan Binner2017-04-271-2/+4
| | | | | | Change-Id: I98ef516031e8057456d8dab6de01576d2734d8f5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add a function to hand off a tcp socket to the websocket serverAleksey Lysenko2017-01-274-11/+35
| | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-257-27/+29
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: If50b73b1f1e293269404bd8b38088119a0f59f1f
| * Fix the parser of port in hand shake requestLiang Qi2017-01-061-10/+6
| | | | | | | | | | | | | | | | | | | | Use QUrl::setAuthority() to parse host and port. The request is invalid when having username or password in Host. Task-number: QTBUG-57357 Change-Id: I4e7c0370794dce15359d372a1e36dc0383083204 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fixed possible block clearing in QWebSocketDataProcessor::process methodAleksey Lysenko2017-01-041-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | In QWebSocketDataProcessor::process() the signals text(binary)MessageReceived are emitted before clear() method. If signal handler blocks loop (for example, using QDialog::exec()), clear() will be called only after resuming loop. It may lead to the data corruption due to the fact that QWebSocketDataProcessor clearing won't be performed before the new data arrived. Task-number: QTBUG-55506 Change-Id: Ib7016a91d3987dec7c1af977b17f86a53568c413 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Fixed wrong scheme for secure websocketAleksey Lysenko2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | Websocket server always constructed QWebSocketHandshakeRequest like for non-secure socket without checking SecureMode. This led to the fact that secure socket had "ws" scheme. Task-number: QTBUG-55927 Change-Id: I881766f55182136072fd23f3fefe93ea60f3d27d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>