From 88946bbe209cb6148b4a3284077bb9a06c7bc1ef Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Fri, 12 Feb 2016 14:18:30 +0100 Subject: Doc: Remove reference to Qt Cloud service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-51087 Change-Id: I98190d1981c864ee3fc5dc6d7e5375527536adfd Reviewed-by: Topi Reiniö --- src/websockets/doc/src/overview.qdoc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/websockets/doc/src/overview.qdoc b/src/websockets/doc/src/overview.qdoc index df080c1..3250828 100644 --- a/src/websockets/doc/src/overview.qdoc +++ b/src/websockets/doc/src/overview.qdoc @@ -90,23 +90,22 @@ for push notification when there is a change in price of a few stocks. The module provides both C++ and QML versions of the API, so you can choose the alternative that suits your need. -\section2 Qt WebSockets with Qt Cloud Services +\section2 Qt WebSockets with Cloud Services The client application usually depends on an external service for data. Most of these service providers do not support WebSocket yet, so you end up developing -a WebSocket-aware server application to bridge the gap. You can choose to run -the server on an enterprise WebSocket gateway service such as Qt Cloud -Services, avoiding the hassle of maintaining the necessary infrastructure -required to host such a service. +a WebSocket-aware server application to bridge the gap. You can run the server +on an enterprise WebSocket gateway service such as a cloud service, avoiding +the hassle of maintaining the necessary infrastructure required to host such +a service. -The Qt Cloud Services provides a Managed Application Runtime (MAR) backend, -which enables deploying and running an instance of server application on the -cloud. The server instance running on MAR gets a WebSocket URL, which can be -used by the client applications to connect and receive data. +Most of the cloud Services provide a Platform as a service (PaaS) backend, +which enables deploying and running an instance of your server application on +the cloud. The client applications can connect to the running server using a +WebSocket URL and receive data. \section2 Related Information \list \li \l {http://tools.ietf.org/html/rfc6455}{WebSocket RFC 6455} -\li \l {https://qtcloudservices.com}{Qt Cloud Services} \endlist */ -- cgit v1.2.1 From b7aa461042ac1dfa22212a2783323d6ce1fd69fd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 31 Aug 2015 16:44:01 +0200 Subject: Update the QWebSocket's QSslConfiguration when needed 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 --- src/websockets/qwebsocket_p.cpp | 19 +++++++++++++++++++ src/websockets/qwebsocket_p.h | 1 + 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 1722c15..0eadc93 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -275,6 +275,15 @@ void QWebSocketPrivate::ignoreSslErrors() } } +/*! +* \internal +*/ +void QWebSocketPrivate::_q_updateSslConfiguration() +{ + if (QSslSocket *sslSock = qobject_cast(m_pSocket)) + m_configuration.m_sslConfiguration = sslSock->sslConfiguration(); +} + #endif /*! @@ -294,6 +303,10 @@ QWebSocket *QWebSocketPrivate::upgradeFrom(QTcpSocket *pTcpSocket, headerIter.next(); netRequest.setRawHeader(headerIter.key().toLatin1(), headerIter.value().toLatin1()); } +#ifndef QT_NO_SSL + if (QSslSocket *sslSock = qobject_cast(pTcpSocket)) + pWebSocket->setSslConfiguration(sslSock->sslConfiguration()); +#endif pWebSocket->d_func()->setExtension(response.acceptedExtension()); pWebSocket->d_func()->setOrigin(request.origin()); pWebSocket->d_func()->setRequest(netRequest); @@ -579,6 +592,8 @@ void QWebSocketPrivate::makeConnections(const QTcpSocket *pTcpSocket) QObject::connect(sslSocket, static_cast(&QSslSocket::sslErrors), q, &QWebSocket::sslErrors); + QObjectPrivate::connect(sslSocket, &QSslSocket::encrypted, + this, &QWebSocketPrivate::_q_updateSslConfiguration); } else #endif // QT_NO_SSL { @@ -1058,6 +1073,10 @@ void QWebSocketPrivate::processStateChanged(QAbstractSocket::SocketState socketS switch (socketState) { case QAbstractSocket::ConnectedState: +#ifndef QT_NO_SSL + if (QSslSocket *sslSock = qobject_cast(m_pSocket)) + m_configuration.m_sslConfiguration = sslSock->sslConfiguration(); +#endif if (webSocketState == QAbstractSocket::ConnectingState) { m_key = generateKey(); diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h index 037df61..b7e1a81 100644 --- a/src/websockets/qwebsocket_p.h +++ b/src/websockets/qwebsocket_p.h @@ -141,6 +141,7 @@ public: void ignoreSslErrors(); void setSslConfiguration(const QSslConfiguration &sslConfiguration); QSslConfiguration sslConfiguration() const; + void _q_updateSslConfiguration(); #endif void closeGoingAway(); -- cgit v1.2.1 From be4bfc5feeb61e97378bee325d36bb74f007fe04 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 7 Apr 2016 09:52:29 +0200 Subject: Doc: Add external-resources.qdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also sanitize some linking, e.g. by referencing to the paper by title, not by link. Change-Id: I95482994ca569001a23a3beb0e3cbe6739f4ed77 Reviewed-by: Leena Miettinen Reviewed-by: Topi Reiniö --- src/imports/qmlwebsockets/qqmlwebsocket.cpp | 3 +- src/websockets/doc/src/external-resources.qdoc | 106 +++++++++++++++++++++++++ src/websockets/doc/src/index.qdoc | 8 +- src/websockets/doc/src/overview.qdoc | 2 +- src/websockets/qdefaultmaskgenerator_p.cpp | 4 +- src/websockets/qmaskgenerator.cpp | 4 +- src/websockets/qwebsocket.cpp | 16 ++-- src/websockets/qwebsocketcorsauthenticator.cpp | 2 +- src/websockets/qwebsocketdataprocessor.cpp | 2 +- src/websockets/qwebsocketprotocol.cpp | 18 ++--- src/websockets/qwebsocketserver.cpp | 9 +-- 11 files changed, 136 insertions(+), 38 deletions(-) create mode 100644 src/websockets/doc/src/external-resources.qdoc (limited to 'src') diff --git a/src/imports/qmlwebsockets/qqmlwebsocket.cpp b/src/imports/qmlwebsockets/qqmlwebsocket.cpp index 82a5f9b..ef97413 100644 --- a/src/imports/qmlwebsockets/qqmlwebsocket.cpp +++ b/src/imports/qmlwebsockets/qqmlwebsocket.cpp @@ -42,8 +42,7 @@ WebSockets is a web technology providing full-duplex communications channels over a single TCP connection. - The WebSocket protocol was standardized by the IETF as - \l {http://tools.ietf.org/html/rfc6455} {RFC 6455} in 2011. + The WebSocket protocol was standardized by the IETF as \l {RFC 6455} in 2011. */ /*! diff --git a/src/websockets/doc/src/external-resources.qdoc b/src/websockets/doc/src/external-resources.qdoc new file mode 100644 index 0000000..be49ded --- /dev/null +++ b/src/websockets/doc/src/external-resources.qdoc @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \externalpage http://w2spconf.com/2011/papers/websocket.pdf + \title "Talking to Yourself for Fun and Profit" by Lin-Shung Huang et al +*/ + +/*! + \externalpage http://tools.ietf.org/html/rfc6454 + \title RFC 6454 +*/ + +/*! + \externalpage http://tools.ietf.org/html/rfc6455 + \title RFC 6455 +*/ + +/*! + \externalpage http://tools.ietf.org/html/rfc6455#section-10 + \title WebSocket Security Considerations +*/ + +/*! + \externalpage http://tools.ietf.org/html/rfc6455#page-39 + \title WebSocket Extensions +*/ + +/*! + \externalpage http://tools.ietf.org/html/rfc6455#page-12 + \title WebSocket Subprotocols +*/ + +/*! + \externalpage http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 + \title hixie76 +*/ + +/*! + \externalpage http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00 + \title hybi-00 +*/ + +/*! + \externalpage http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-04.txt + \title hybi-04 +*/ + +/*! + \externalpage http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-05.txt + \title hybi-05 +*/ + +/*! + \externalpage http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07 + \title hybi-07 +*/ + +/*! + \externalpage https://github.com/google/pywebsocket/wiki/WebSocketProtocolSpec + \title pywebsocket's WebSocketProtocolSpec +*/ + +/*! + \externalpage http://autobahn.ws/testsuite/ + \title Autobahn|Testsuite +*/ + +/*! + \externalpage http://autobahn.ws/testsuite/installation.html + \title Autobahn|Testsuite installation documentation +*/ + +/*! + \externalpage https://www.mozilla.org/firefox + \title Firefox +*/ + +/*! + \externalpage https://bugzilla.mozilla.org/show_bug.cgi?id=594502 + \title Firefox bug 594502 +*/ diff --git a/src/websockets/doc/src/index.qdoc b/src/websockets/doc/src/index.qdoc index e0f219c..9e1c40c 100644 --- a/src/websockets/doc/src/index.qdoc +++ b/src/websockets/doc/src/index.qdoc @@ -77,10 +77,10 @@ \page qtwebsockets-testing.html \title Testing Qt WebSockets - \l {http://autobahn.ws/testsuite/}{Autobahn|Testsuite}, a standard test - suite for WebSocket Protocol (RFC 6455), can be used for testing the - conformance of Qt WebSockets. Refer to Autobahn|Testsuite - \l {http://autobahn.ws/testsuite/installation.html}{installation documentation} + \l {Autobahn|Testsuite}, a standard test + suite for WebSocket Protocol (\l{RFC 6455}), can be used for testing the + conformance of Qt WebSockets. Refer to + \l {Autobahn|Testsuite installation documentation} to set up the test suite. \include README testsuite diff --git a/src/websockets/doc/src/overview.qdoc b/src/websockets/doc/src/overview.qdoc index 3250828..eb9e429 100644 --- a/src/websockets/doc/src/overview.qdoc +++ b/src/websockets/doc/src/overview.qdoc @@ -106,6 +106,6 @@ WebSocket URL and receive data. \section2 Related Information \list -\li \l {http://tools.ietf.org/html/rfc6455}{WebSocket RFC 6455} +\li \l{RFC 6455} \endlist */ diff --git a/src/websockets/qdefaultmaskgenerator_p.cpp b/src/websockets/qdefaultmaskgenerator_p.cpp index 0992e3a..9a8ef30 100644 --- a/src/websockets/qdefaultmaskgenerator_p.cpp +++ b/src/websockets/qdefaultmaskgenerator_p.cpp @@ -37,11 +37,11 @@ \brief The QDefaultMaskGenerator class provides the default mask generator for QtWebSockets. - The WebSockets specification as outlined in {http://tools.ietf.org/html/rfc6455}{RFC 6455} + The WebSockets specification as outlined in \l {RFC 6455} requires that all communication from client to server must be masked. This is to prevent malicious scripts to attack bad behaving proxies. For more information about the importance of good masking, - see \l {http://w2spconf.com/2011/papers/websocket.pdf}. + see \l {"Talking to Yourself for Fun and Profit" by Lin-Shung Huang et al}. The default mask generator uses the cryptographically insecure qrand() function. The best measure against attacks mentioned in the document above, is to use QWebSocket over a secure connection (\e wss://). diff --git a/src/websockets/qmaskgenerator.cpp b/src/websockets/qmaskgenerator.cpp index cc53156..88baab6 100644 --- a/src/websockets/qmaskgenerator.cpp +++ b/src/websockets/qmaskgenerator.cpp @@ -39,11 +39,11 @@ \brief The QMaskGenerator class provides an abstract base for custom 32-bit mask generators. - The WebSockets specification as outlined in \l {http://tools.ietf.org/html/rfc6455}{RFC 6455} + The WebSockets specification as outlined in \l {RFC 6455} requires that all communication from client to server be masked. This is to prevent malicious scripts from attacking badly behaving proxies. For more information about the importance of good masking, - see \l {http://w2spconf.com/2011/papers/websocket.pdf}. + see \l {"Talking to Yourself for Fun and Profit" by Lin-Shung Huang et al}. By default QWebSocket uses the cryptographically insecure qrand() function. The best measure against attacks mentioned in the document above, is to use QWebSocket over a secure connection (\e wss://). diff --git a/src/websockets/qwebsocket.cpp b/src/websockets/qwebsocket.cpp index 0286196..52b5083 100644 --- a/src/websockets/qwebsocket.cpp +++ b/src/websockets/qwebsocket.cpp @@ -41,17 +41,17 @@ WebSockets is a web technology providing full-duplex communications channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as - \l {http://tools.ietf.org/html/rfc6455} {RFC 6455} in 2011. + \l {RFC 6455} in 2011. QWebSocket can both be used in a client application and server application. This class was modeled after QAbstractSocket. QWebSocket currently does not support - \l {http://tools.ietf.org/html/rfc6455#page-39} {extensions} and - \l {http://tools.ietf.org/html/rfc6455#page-12} {subprotocols}. + \l {WebSocket Extensions} and + \l {WebSocket Subprotocols}. QWebSocket only supports version 13 of the WebSocket protocol, as outlined in - \l {http://tools.ietf.org/html/rfc6455}{RFC 6455}. + \l {RFC 6455}. \note Some proxies do not understand certain HTTP headers used during a WebSocket handshake. In that case, non-secure WebSocket connections fail. The best way to mitigate against @@ -60,7 +60,7 @@ \warning To generate masks, this implementation of WebSockets uses the cryptographically insecure qrand() function. For more information about the importance of good masking, - see \l {http://w2spconf.com/2011/papers/websocket.pdf}. + see \l {"Talking to Yourself for Fun and Profit" by Lin-Shung Huang et al}. The best measure against attacks mentioned in the document above, is to use QWebSocket over a secure connection (\e wss://). In general, always be careful to not have 3rd party script access to @@ -259,12 +259,12 @@ QT_BEGIN_NAMESPACE * \brief Creates a new QWebSocket with the given \a origin, * the \a version of the protocol to use and \a parent. * - * The \a origin of the client is as specified in \l {http://tools.ietf.org/html/rfc6454}{RFC 6454}. + * The \a origin of the client is as specified in \l {RFC 6454}. * (The \a origin is not required for non-web browser clients - * (see \l {http://tools.ietf.org/html/rfc6455}{RFC 6455})). + * (see \l {RFC 6455})). * The \a origin may not contain new line characters, otherwise the connection will be * aborted immediately during the handshake phase. - * \note Currently only V13 (\l {http://tools.ietf.org/html/rfc6455} {RFC 6455}) is supported + * \note Currently only V13 (\l {RFC 6455}) is supported */ QWebSocket::QWebSocket(const QString &origin, QWebSocketProtocol::Version version, diff --git a/src/websockets/qwebsocketcorsauthenticator.cpp b/src/websockets/qwebsocketcorsauthenticator.cpp index 4645302..7e544a6 100644 --- a/src/websockets/qwebsocketcorsauthenticator.cpp +++ b/src/websockets/qwebsocketcorsauthenticator.cpp @@ -53,7 +53,7 @@ \note Checking on the origin does not make much sense when the server is accessed via a non-browser client, as that client can set whatever origin header it likes. In case of a browser client, the server SHOULD check the validity of the origin. - \sa http://tools.ietf.org/html/rfc6455#section-10 + \sa {WebSocket Security Considerations} \sa QWebSocketServer */ diff --git a/src/websockets/qwebsocketdataprocessor.cpp b/src/websockets/qwebsocketdataprocessor.cpp index 6ffd751..79a50ad 100644 --- a/src/websockets/qwebsocketdataprocessor.cpp +++ b/src/websockets/qwebsocketdataprocessor.cpp @@ -34,7 +34,7 @@ \class QWebSocketDataProcessor The class QWebSocketDataProcessor is responsible for reading, validating and interpreting data from a WebSocket. - It reads data from a QIODevice, validates it against RFC 6455, and parses it into + It reads data from a QIODevice, validates it against \l{RFC 6455}, and parses it into frames (data, control). It emits signals that correspond to the type of the frame: textFrameReceived(), binaryFrameReceived(), textMessageReceived(), binaryMessageReceived(), pingReceived(), diff --git a/src/websockets/qwebsocketprotocol.cpp b/src/websockets/qwebsocketprotocol.cpp index 77b4a4c..eb75f24 100644 --- a/src/websockets/qwebsocketprotocol.cpp +++ b/src/websockets/qwebsocketprotocol.cpp @@ -76,40 +76,34 @@ QT_BEGIN_NAMESPACE \brief The different defined versions of the WebSocket protocol. For an overview of the differences between the different protocols, see - + \l {pywebsocket's WebSocketProtocolSpec}. \value VersionUnknown Unknown or unspecified version. - \value Version0 hixie76: - http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 & - hybi-00: - http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00. + \value Version0 \l{hixie76} and \l{hybi-00}. Works with key1, key2 and a key in the payload. Attribute: Sec-WebSocket-Draft value 0. Not supported by QtWebSockets. - \value Version4 hybi-04: - http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-04.txt. + \value Version4 \l{hybi-04}. Changed handshake: key1, key2, key3 ==> Sec-WebSocket-Key, Sec-WebSocket-Nonce, Sec-WebSocket-Accept Sec-WebSocket-Draft renamed to Sec-WebSocket-Version Sec-WebSocket-Version = 4. Not supported by QtWebSockets. - \value Version5 hybi-05: - http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-05.txt. + \value Version5 \l{hybi-05}. Sec-WebSocket-Version = 5 Removed Sec-WebSocket-Nonce Added Sec-WebSocket-Accept. Not supported by QtWebSockets. \value Version6 Sec-WebSocket-Version = 6. Not supported by QtWebSockets. - \value Version7 hybi-07: - http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07. + \value Version7 \l{hybi-07}. Sec-WebSocket-Version = 7. Not supported by QtWebSockets. \value Version8 hybi-8, hybi-9, hybi-10, hybi-11 and hybi-12. Status codes 1005 and 1006 are added and all codes are now unsigned Internal error results in 1006. Not supported by QtWebSockets. - \value Version13 hybi-13, hybi14, hybi-15, hybi-16, hybi-17 and RFC 6455. + \value Version13 hybi-13, hybi14, hybi-15, hybi-16, hybi-17 and \l{RFC 6455}. Sec-WebSocket-Version = 13 Status code 1004 is now reserved Added 1008, 1009 and 1010 diff --git a/src/websockets/qwebsocketserver.cpp b/src/websockets/qwebsocketserver.cpp index 49d8799..ff64f3e 100644 --- a/src/websockets/qwebsocketserver.cpp +++ b/src/websockets/qwebsocketserver.cpp @@ -60,17 +60,16 @@ Calling close() makes QWebSocketServer stop listening for incoming connections. QWebSocketServer currently does not support - \l {http://tools.ietf.org/html/rfc6455#page-39} {extensions} and - \l {http://tools.ietf.org/html/rfc6455#page-12} {subprotocols}. + \l {WebSocket Extensions} and + \l {WebSocket Subprotocols}. - \note When working with self-signed certificates, FireFox currently has a - \l {https://bugzilla.mozilla.org/show_bug.cgi?id=594502} {bug} that prevents it to + \note When working with self-signed certificates, \l{Firefox bug 594502} prevents \l{Firefox} to connect to a secure WebSocket server. To work around this problem, first browse to the secure WebSocket server using HTTPS. FireFox will indicate that the certificate is invalid. From here on, the certificate can be added to the exceptions. After this, the secure WebSockets connection should work. - QWebSocketServer only supports version 13 of the WebSocket protocol, as outlined in RFC 6455. + QWebSocketServer only supports version 13 of the WebSocket protocol, as outlined in \l{RFC 6455}. \sa {WebSocket Server Example}, QWebSocket */ -- cgit v1.2.1 From a126127f2c2bc1c8f4c7e44ea543057397bbdafa Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 7 Apr 2016 13:47:16 +0200 Subject: Doc: Avoid auto-linking of WebSocket, WebSockets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable the automatic linking of 'WebSocket' to the QML type, and 'WebSockets' to a section in the general documentation. Instead, make the linking explicit where it makes sense. This patch is inspired by 0228a5bd581ae6d672ce5f3 in qtwebengine. Change-Id: I80886360d5f7fdaa68a5e5f6fa982137c7187719 Reviewed-by: Leena Miettinen Reviewed-by: Topi Reiniö --- src/imports/qmlwebsockets/qqmlwebsocket.cpp | 4 ++-- src/imports/qmlwebsockets/qqmlwebsocketserver.cpp | 2 +- src/websockets/doc/src/external-resources.qdoc | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/imports/qmlwebsockets/qqmlwebsocket.cpp b/src/imports/qmlwebsockets/qqmlwebsocket.cpp index ef97413..07ef925 100644 --- a/src/imports/qmlwebsockets/qqmlwebsocket.cpp +++ b/src/imports/qmlwebsockets/qqmlwebsocket.cpp @@ -86,9 +86,9 @@ /*! \qmlsignal WebSocket::statusChanged(Status status) This signal is emitted when the status of the WebSocket changes. - the \l {WebSocket::status}{status} argument provides the current status. + the \l [QML]{WebSocket::status}{status} argument provides the current status. - \sa WebSocket::status + \sa {QtWebSockets::}{WebSocket::status} */ /*! diff --git a/src/imports/qmlwebsockets/qqmlwebsocketserver.cpp b/src/imports/qmlwebsockets/qqmlwebsocketserver.cpp index ea666a6..6572a17 100644 --- a/src/imports/qmlwebsockets/qqmlwebsocketserver.cpp +++ b/src/imports/qmlwebsockets/qqmlwebsocketserver.cpp @@ -90,7 +90,7 @@ QT_USE_NAMESPACE /*! \qmlsignal WebSocketServer::clientConnected(WebSocket webSocket) - This signal is emitted when a client connects to this server. + This signal is emitted when a client connects to this server. \a webSocket is the newly created \l [QML]{WebSocket}. */ QQmlWebSocketServer::QQmlWebSocketServer(QObject *parent) diff --git a/src/websockets/doc/src/external-resources.qdoc b/src/websockets/doc/src/external-resources.qdoc index be49ded..933ef7f 100644 --- a/src/websockets/doc/src/external-resources.qdoc +++ b/src/websockets/doc/src/external-resources.qdoc @@ -103,4 +103,24 @@ /*! \externalpage https://bugzilla.mozilla.org/show_bug.cgi?id=594502 \title Firefox bug 594502 + +/* + This prevents autolinking of each occurrence of 'WebSocket' + To link to the WebSocket QML type, use explicit linking: + \l [QML] WebSocket + \sa {QtWebSockets::}{WebSocket} +*/ +/*! + \externalpage nolink + \title WebSocket + \internal +*/ + +/* + Prevent linking to WebSockets section in "Networking and Connectivity" +*/ +/*! + \externalpage nolink + \title WebSockets + \internal */ -- cgit v1.2.1 From ba9306ec5a1271275d79b2f48ceb227f79352f33 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 7 Apr 2016 14:40:07 +0200 Subject: Fix possible hang on handshake processHandShake operates on complete lines. If the data available does not contain the full handshake message, the loop will therefore never return. Task-number: QTBUG-51001 Change-Id: Ie87f5b5dee01116f463e84f06feab502ff5ac563 Reviewed-by: Joerg Bornemann --- src/websockets/qwebsocket_p.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 0eadc93..2fd52fe 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -1142,10 +1142,13 @@ void QWebSocketPrivate::processData() { Q_ASSERT(m_pSocket); while (m_pSocket->bytesAvailable()) { - if (state() == QAbstractSocket::ConnectingState) + if (state() == QAbstractSocket::ConnectingState) { + if (!m_pSocket->canReadLine()) + break; processHandshake(m_pSocket); - else + } else { m_dataProcessor.process(m_pSocket); + } } } -- cgit v1.2.1