summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 16:08:59 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 16:09:40 +0100
commit258d019df60bc346a6fa89da694e52c4743dc18b (patch)
tree30a1a71f8ade0773ee6b0407a90ce9be5f438f1e /src
parente66955ac63767cfad8c60de6faa8d367a8bc19f2 (diff)
parent29d9f1d867f84dede86cb41c27e38541a24186ff (diff)
downloadqtwebsockets-258d019df60bc346a6fa89da694e52c4743dc18b.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I7215c289188462383799269aa9b736ae76db4d25
Diffstat (limited to 'src')
-rw-r--r--src/websockets/doc/qtwebsockets.qdocconf4
-rw-r--r--src/websockets/doc/src/index.qdoc3
-rw-r--r--src/websockets/qmaskgenerator.cpp6
-rw-r--r--src/websockets/qwebsocket.cpp14
-rw-r--r--src/websockets/qwebsocket.h1
-rw-r--r--src/websockets/qwebsocket_p.cpp7
-rw-r--r--src/websockets/qwebsocket_p.h2
-rw-r--r--src/websockets/qwebsocketcorsauthenticator.cpp8
-rw-r--r--src/websockets/qwebsocketserver.cpp20
9 files changed, 34 insertions, 31 deletions
diff --git a/src/websockets/doc/qtwebsockets.qdocconf b/src/websockets/doc/qtwebsockets.qdocconf
index 7822edc..db1553d 100644
--- a/src/websockets/doc/qtwebsockets.qdocconf
+++ b/src/websockets/doc/qtwebsockets.qdocconf
@@ -48,9 +48,11 @@ sourcedirs += .. \
../../imports
-exampledirs += ../../../examples/ \
+exampledirs += ../../../examples/websockets \
snippets
+manifestmeta.thumbnail.names += "QtWebSockets/*"
+
navigation.landingpage = "Qt WebSockets"
navigation.cppclassespage = "Qt WebSockets C++ Classes"
navigation.qmltypespage = "Qt WebSockets QML Types"
diff --git a/src/websockets/doc/src/index.qdoc b/src/websockets/doc/src/index.qdoc
index 2961ef3..1d05585 100644
--- a/src/websockets/doc/src/index.qdoc
+++ b/src/websockets/doc/src/index.qdoc
@@ -58,7 +58,6 @@
\section1 Examples
- The module provides the following examples as a guide to using
+ The module provides the following \l{Qt WebSockets Examples}{Examples} as a guide to using
the API.
- \l{Qt WebSockets Examples}{Examples}
*/
diff --git a/src/websockets/qmaskgenerator.cpp b/src/websockets/qmaskgenerator.cpp
index 04f5e1e..09305ab 100644
--- a/src/websockets/qmaskgenerator.cpp
+++ b/src/websockets/qmaskgenerator.cpp
@@ -46,9 +46,9 @@
\brief The QMaskGenerator class provides an abstract base for custom 32-bit mask generators.
- The WebSockets specification as outlined in {http://tools.ietf.org/html/rfc6455}{RFC 6455}
- requires that all communication from client to server must be masked. This is to prevent
- malicious scripts to attack bad behaving proxies.
+ The WebSockets specification as outlined in \l {http://tools.ietf.org/html/rfc6455}{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}.
By default QWebSocket uses the cryptographically insecure qrand() function.
diff --git a/src/websockets/qwebsocket.cpp b/src/websockets/qwebsocket.cpp
index 85b45c0..825d66c 100644
--- a/src/websockets/qwebsocket.cpp
+++ b/src/websockets/qwebsocket.cpp
@@ -143,7 +143,7 @@ not been filled in with new information when the signal returns.
This signal is emitted whenever QWebSocket's state changes.
The \a state parameter is the new state.
- \note QAbstractSocket::ConnectedState is emitted after the handshake has
+ \note QAbstractSocket::ConnectedState is emitted after the handshake
with the server has succeeded.
QAbstractSocket::SocketState is not a registered metatype, so for queued
@@ -168,7 +168,7 @@ not been filled in with new information when the signal returns.
\note This signal has the same meaning both for secure and non-secure websockets.
As opposed to QSslSocket, bytesWritten() is only emitted when encrypted data is effectively
- written (see QSslSocket:encryptedBytesWritten()).
+ written (see QSslSocket::encryptedBytesWritten()).
\sa close()
*/
@@ -266,7 +266,7 @@ 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 \l {http://tools.ietf.org/html/rfc6454}{RFC 6454}.
+ * The \a origin of the client is as specified in \l {http://tools.ietf.org/html/rfc6454}{RFC 6454}.
* (The \a origin is not required for non-web browser clients
* (see \l {http://tools.ietf.org/html/rfc6455}{RFC 6455})).
* The \a origin may not contain new line characters, otherwise the connection will be
@@ -496,7 +496,7 @@ QSslConfiguration QWebSocket::sslConfiguration() const
#endif //not QT_NO_SSL
/*!
- \brief Returns the version the socket is currently using
+ \brief Returns the version the socket is currently using.
*/
QWebSocketProtocol::Version QWebSocket::version() const
{
@@ -523,7 +523,7 @@ QUrl QWebSocket::requestUrl() const
}
/*!
- \brief Returns the current origin
+ \brief Returns the current origin.
*/
QString QWebSocket::origin() const
{
@@ -552,7 +552,7 @@ QString QWebSocket::closeReason() const
}
/*!
- \brief Returns the current state of the socket
+ \brief Returns the current state of the socket.
*/
QAbstractSocket::SocketState QWebSocket::state() const
{
@@ -703,7 +703,7 @@ void QWebSocket::setPauseMode(QAbstractSocket::PauseModes pauseMode)
Exceptionally, a buffer size of 0 means that the read buffer is unlimited and
all incoming data is buffered. This is the default.
This option is useful if you only read the data at certain points in time
- (e.g., in a real-time streaming application) or if you want to protect your socket against
+ (for example, in a real-time streaming application) or if you want to protect your socket against
receiving too much data, which may eventually cause your application to run out of memory.
\sa readBufferSize()
diff --git a/src/websockets/qwebsocket.h b/src/websockets/qwebsocket.h
index c6de981..bf85cc0 100644
--- a/src/websockets/qwebsocket.h
+++ b/src/websockets/qwebsocket.h
@@ -43,6 +43,7 @@
#define QWEBSOCKET_H
#include <QtCore/QUrl>
+#include <QtNetwork/QAbstractSocket>
#ifndef QT_NO_NETWORKPROXY
#include <QtNetwork/QNetworkProxy>
#endif
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index c51ba38..fb6486e 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -78,9 +78,10 @@ QWebSocketConfiguration::QWebSocketConfiguration() :
m_ignoredSslErrors(),
m_ignoreSslErrors(false),
#endif
-#ifndef QT_NONETWORKPROXY
- m_proxy(QNetworkProxy::DefaultProxy)
+#ifndef QT_NO_NETWORKPROXY
+ m_proxy(QNetworkProxy::DefaultProxy),
#endif
+ m_pSocket(Q_NULLPTR)
{
}
@@ -541,8 +542,10 @@ void QWebSocketPrivate::makeConnections(const QTcpSocket *pTcpSocket)
QObject::connect(pTcpSocket,
static_cast<ASErrorSignal>(&QAbstractSocket::error),
q, static_cast<WSErrorSignal>(&QWebSocket::error));
+#ifndef QT_NO_NETWORKPROXY
QObject::connect(pTcpSocket, &QAbstractSocket::proxyAuthenticationRequired, q,
&QWebSocket::proxyAuthenticationRequired);
+#endif
QObject::connect(pTcpSocket, &QAbstractSocket::readChannelFinished, q,
&QWebSocket::readChannelFinished);
QObject::connect(pTcpSocket, &QAbstractSocket::aboutToClose, q, &QWebSocket::aboutToClose);
diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h
index b24d540..5c65450 100644
--- a/src/websockets/qwebsocket_p.h
+++ b/src/websockets/qwebsocket_p.h
@@ -91,7 +91,7 @@ public:
QList<QSslError> m_ignoredSslErrors;
bool m_ignoreSslErrors;
#endif
-#ifndef QT_NONETWORKPROXY
+#ifndef QT_NO_NETWORKPROXY
QNetworkProxy m_proxy;
#endif
QTcpSocket *m_pSocket;
diff --git a/src/websockets/qwebsocketcorsauthenticator.cpp b/src/websockets/qwebsocketcorsauthenticator.cpp
index be126ef..fd4bb8c 100644
--- a/src/websockets/qwebsocketcorsauthenticator.cpp
+++ b/src/websockets/qwebsocketcorsauthenticator.cpp
@@ -52,7 +52,7 @@
It provides applications with fine-grained control over which origin URLs are allowed
and which aren't.
By default, every origin is accepted.
- To get fine grained control, an application connects the
+ To get fine-grained control, an application connects the
\l{QWebSocketServer::}{originAuthenticationRequired()} signal to a slot.
When the origin (QWebSocketCorsAuthenticator::origin()) is accepted,
it calls QWebSocketCorsAuthenticator::setAllowed(true)
@@ -95,14 +95,14 @@ QWebSocketCorsAuthenticator::QWebSocketCorsAuthenticator(const QString &origin)
}
/*!
- Destroys the object
+ Destroys the object.
*/
QWebSocketCorsAuthenticator::~QWebSocketCorsAuthenticator()
{
}
/*!
- Constructs a copy of \a other
+ Constructs a copy of \a other.
*/
QWebSocketCorsAuthenticator::QWebSocketCorsAuthenticator(const QWebSocketCorsAuthenticator &other) :
d_ptr(new QWebSocketCorsAuthenticatorPrivate(other.d_ptr->m_origin, other.d_ptr->m_isAllowed))
@@ -110,7 +110,7 @@ QWebSocketCorsAuthenticator::QWebSocketCorsAuthenticator(const QWebSocketCorsAut
}
/*!
- Assigns \a other to this authenticator object
+ Assigns \a other to this authenticator object.
*/
QWebSocketCorsAuthenticator &
QWebSocketCorsAuthenticator::operator =(const QWebSocketCorsAuthenticator &other)
diff --git a/src/websockets/qwebsocketserver.cpp b/src/websockets/qwebsocketserver.cpp
index 884f422..58c3cc9 100644
--- a/src/websockets/qwebsocketserver.cpp
+++ b/src/websockets/qwebsocketserver.cpp
@@ -79,9 +79,7 @@
QWebSocketServer only supports version 13 of the WebSocket protocol, as outlined in RFC 6455.
- \sa echoserver.html
-
- \sa QWebSocket
+ \sa {WebSocket Server Example}, QWebSocket
*/
/*!
@@ -122,8 +120,8 @@
/*!
\fn void QWebSocketServer::acceptError(QAbstractSocket::SocketError socketError)
- This signal is emitted when accepting a new connection results in an error.
- The \a socketError parameter describes the type of error that occurred
+ This signal is emitted when the acceptance of a new connection results in an error.
+ The \a socketError parameter describes the type of error that occurred.
\sa pauseAccepting(), resumeAccepting()
*/
@@ -145,7 +143,7 @@
/*!
\fn void QWebSocketServer::closed()
- This signal is emitted when the server closed it's connection.
+ This signal is emitted when the server closed its connection.
\sa close()
*/
@@ -155,7 +153,7 @@
This signal is emitted when a new connection is requested.
The slot connected to this signal should indicate whether the origin
(which can be determined by the origin() call) is allowed in the \a authenticator object
- (by issuing \l{QWebSocketCorsAuthenticator::}{setAllowed()})
+ (by issuing \l{QWebSocketCorsAuthenticator::}{setAllowed()}).
If no slot is connected to this signal, all origins will be accepted by default.
@@ -172,7 +170,7 @@
usually an indication that QWebSocketServer is unable to securely identify the
peer.
- This signal provides you with an early indication when something's wrong.
+ This signal provides you with an early indication when something is wrong.
By connecting to this signal, you can manually choose to tear down the
connection from inside the connected slot before the handshake has
completed. If no action is taken, QWebSocketServer will proceed to emitting
@@ -221,7 +219,7 @@ QT_BEGIN_NAMESPACE
/*!
Constructs a new QWebSocketServer with the given \a serverName.
- The \a serverName will be used in the http handshake phase to identify the server.
+ The \a serverName will be used in the HTTP handshake phase to identify the server.
It can be empty, in which case an empty server name will be sent to the client.
The \a secureMode parameter indicates whether the server operates over wss (\l{SecureMode})
or over ws (\l{NonSecureMode}).
@@ -331,7 +329,7 @@ int QWebSocketServer::maxPendingConnections() const
/*!
Returns the next pending connection as a connected QWebSocket object.
QWebSocketServer does not take ownership of the returned QWebSocket object.
- It is up to the caller to delete the object explicitly when it is done using it,
+ It is up to the caller to delete the object explicitly when it will no longer be used,
otherwise a memory leak will occur.
Q_NULLPTR is returned if this function is called when there are no pending connections.
@@ -424,7 +422,7 @@ void QWebSocketServer::resumeAccepting()
}
/*!
- Sets the server name that will be used during the http handshake phase to the given
+ Sets the server name that will be used during the HTTP handshake phase to the given
\a serverName.
The \a serverName can be empty, in which case an empty server name will be sent to the client.
Existing connected clients will not be notified of this change, only newly connecting clients