Doc: Language/writ. guidelines review Qt WebSockets
authorNico Vertriest <nico.vertriest@digia.com>
Wed, 12 Mar 2014 13:47:17 +0000 (14:47 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 14 Mar 2014 14:26:35 +0000 (15:26 +0100)
Task-number: QTBUG-37149
Change-Id: Ic0c28928404fc515de40e6fdff11849cdb2929d6
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
src/websockets/doc/src/index.qdoc
src/websockets/qmaskgenerator.cpp
src/websockets/qwebsocket.cpp
src/websockets/qwebsocketcorsauthenticator.cpp
src/websockets/qwebsocketserver.cpp

index 2961ef3..a487ecc 100644 (file)
@@ -58,7 +58,6 @@
 
     \section1 Examples
 
-    The module provides the following examples as a guide to using
+    The module provides the \l{Qt WebSockets Examples}{Examples} as a guide to using
     the API.
-    \l{Qt WebSockets Examples}{Examples}
 */
index 04f5e1e..09305ab 100644 (file)
@@ -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.
index 85b45c0..825d66c 100644 (file)
@@ -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()
index be126ef..fd4bb8c 100644 (file)
@@ -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)
index 884f422..58c3cc9 100644 (file)
@@ -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
 */
 
 /*!
 
 /*!
     \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()
 */
 
 /*!
     \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()
 */
     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.
 
     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