diff --git a/examples/websockets/doc/echoclient.qdoc b/examples/websockets/doc/echoclient.qdoc index a6cb1a9570d868c34d994cb4addb8518d206ad32..2c6416994955ba0424f3ef4282c6f25e58c1238a 100644 --- a/examples/websockets/doc/echoclient.qdoc +++ b/examples/websockets/doc/echoclient.qdoc @@ -43,9 +43,9 @@ \example echoclient \title Echo Client Example \ingroup qtwebsockets-examples - \brief Describes how to use the websocket API for creating a simple echo client. + \brief Describes how to use the WebSocket API for creating a simple echo client. - The Echo Client Example shows how to use the websocket API to create a simple + The Echo Client Example shows how to use the WebSocket API to create a simple echo client. \sa {Echo Server Example} diff --git a/examples/websockets/doc/echoserver.qdoc b/examples/websockets/doc/echoserver.qdoc index fcb0442821d85fd634716dc44d676aa4384b9edf..ca020bf54f3b1a02accb9d7f2cc4d8b80edaf560 100644 --- a/examples/websockets/doc/echoserver.qdoc +++ b/examples/websockets/doc/echoserver.qdoc @@ -47,7 +47,7 @@ sends back the messages it receives. The Echo Server Example shows how to create a simple server application that - sends back the messages it receives, using the websockets API. + sends back the messages it receives, using the WebSocket API. \sa {Echo Client Example} */ diff --git a/examples/websockets/doc/simplechat.qdoc b/examples/websockets/doc/simplechat.qdoc index 506d45a2d46ef7cf0505a531a7b10ae1f2c95887..13591a06d3aaa43990c22c9f889b86a4be25210e 100644 --- a/examples/websockets/doc/simplechat.qdoc +++ b/examples/websockets/doc/simplechat.qdoc @@ -44,9 +44,9 @@ \title Simple Chat Example \ingroup qtwebsockets-examples \brief Shows how to use the QWebSocket and QWebSocketServer classes - for creating a minimalistic chat application over websockets. + for creating a minimalistic chat application over the WebSocket protocol. The Simple Chat Example shows how to use the QWebSocket and QWebSocketServer - classes to create a minimalistic chat application over websockets. + classes to create a minimalistic chat application over the WebSocket protocol. */ diff --git a/examples/websockets/echoclient/echoclient.cpp b/examples/websockets/echoclient/echoclient.cpp index 9e8ba9b44d9b38453b9842c0fb8b8030e111df34..142a81e1fd0326bbf600ae9b268709042cbf52ac 100644 --- a/examples/websockets/echoclient/echoclient.cpp +++ b/examples/websockets/echoclient/echoclient.cpp @@ -57,7 +57,7 @@ EchoClient::EchoClient(const QUrl &url, QObject *parent) : //! [onConnected] void EchoClient::onConnected() { - qDebug() << "Websocket connected"; + qDebug() << "WebSocket connected"; connect(&m_webSocket, &QWebSocket::textMessageReceived, this, &EchoClient::onTextMessageReceived); m_webSocket.sendTextMessage(QStringLiteral("Hello, world!")); diff --git a/examples/websockets/echoserver/echoclient.html b/examples/websockets/echoserver/echoclient.html index e9c55dc5bbcc8f2d0080776087a07960a118eee0..1edfb6405fb306af2a89dc6a5baf1424f3e10b6e 100644 --- a/examples/websockets/echoserver/echoclient.html +++ b/examples/websockets/echoserver/echoclient.html @@ -1,12 +1,12 @@ <html> <head> - <title>Websocket Echo Client</title> + <title>WebSocket Echo Client</title> </head> <body> - <h1>Websocket Echo Client</h1> + <h1>WebSocket Echo Client</h1> <p> - <button onClick="initWebsocket();">Connect</button> - <button onClick="stopWebsocket();">Disconnect</button> + <button onClick="initWebSocket();">Connect</button> + <button onClick="stopWebSocket();">Disconnect</button> <button onClick="checkSocket();">State</button> </p> <p> @@ -37,7 +37,7 @@ var wsUri = "ws://localhost:1234"; var websocket = null; - function initWebsocket() { + function initWebSocket() { try { if (typeof MozWebSocket == 'function') WebSocket = MozWebSocket; @@ -62,7 +62,7 @@ } } - function stopWebsocket() { + function stopWebSocket() { if (websocket) websocket.close(); } @@ -92,9 +92,9 @@ break; } } - debug("Websocket state = " + websocket.readyState + " ( " + stateStr + " )"); + debug("WebSocket state = " + websocket.readyState + " ( " + stateStr + " )"); } else { - debug("Websocket is null"); + debug("WebSocket is null"); } } </script> diff --git a/examples/websockets/simplechat/chatclient.html b/examples/websockets/simplechat/chatclient.html index 5b077f7cc9c4181a1b718396363c5106684b6467..511d05b17a917c72d31cd63d2719b037046bf9c9 100644 --- a/examples/websockets/simplechat/chatclient.html +++ b/examples/websockets/simplechat/chatclient.html @@ -1,12 +1,12 @@ <html> <head> - <title>Websocket Chat Client</title> + <title>WebSocket Chat Client</title> </head> <body> - <h1>Websocket Chat Client</h1> + <h1>WebSocket Chat Client</h1> <p> - <button onClick="initWebsocket();">Connect</button> - <button onClick="stopWebsocket();">Disconnect</button> + <button onClick="initWebSocket();">Connect</button> + <button onClick="stopWebSocket();">Disconnect</button> <button onClick="checkSocket();">State</button> </p> <p> @@ -41,7 +41,7 @@ var wsUri = "ws://localhost:1234"; var websocket = null; - function initWebsocket() { + function initWebSocket() { try { if (typeof MozWebSocket == 'function') WebSocket = MozWebSocket; @@ -66,7 +66,7 @@ } } - function stopWebsocket() { + function stopWebSocket() { if (websocket) websocket.close(); } @@ -96,9 +96,9 @@ break; } } - debug("Websocket state = " + websocket.readyState + " ( " + stateStr + " )"); + debug("WebSocket state = " + websocket.readyState + " ( " + stateStr + " )"); } else { - debug("Websocket is null"); + debug("WebSocket is null"); } } </script> diff --git a/examples/websockets/sslechoclient/sslechoclient.cpp b/examples/websockets/sslechoclient/sslechoclient.cpp index 037990d6bc84eac612008e99912347916cd04550..2300da29778ebb9b5559bfc5c88a40bd60ffd459 100644 --- a/examples/websockets/sslechoclient/sslechoclient.cpp +++ b/examples/websockets/sslechoclient/sslechoclient.cpp @@ -61,7 +61,7 @@ SslEchoClient::SslEchoClient(const QUrl &url, QObject *parent) : //! [onConnected] void SslEchoClient::onConnected() { - qDebug() << "Websocket connected"; + qDebug() << "WebSocket connected"; connect(&m_webSocket, &QWebSocket::textMessageReceived, this, &SslEchoClient::onTextMessageReceived); m_webSocket.sendTextMessage(QStringLiteral("Hello, world!")); diff --git a/examples/websockets/sslechoserver/sslechoclient.html b/examples/websockets/sslechoserver/sslechoclient.html index b9faa44afde8d3fa91b7e9f8fbc0eb3720fb0028..7ecb1472b73c0089ad6d1ff43142562711cf0648 100644 --- a/examples/websockets/sslechoserver/sslechoclient.html +++ b/examples/websockets/sslechoserver/sslechoclient.html @@ -1,14 +1,14 @@ <!DOCTYPE html> <html> <head> - <title>Websocket Echo Client</title> + <title>WebSocket Echo Client</title> <meta charset="utf-8"> </head> <body> - <h1>Websocket Echo Client</h1> + <h1>WebSocket Echo Client</h1> <p> - <button onClick="initWebsocket();">Connect</button> - <button onClick="stopWebsocket();">Disconnect</button> + <button onClick="initWebSocket();">Connect</button> + <button onClick="stopWebSocket();">Disconnect</button> <button onClick="checkSocket();">State</button> </p> <p> @@ -39,7 +39,7 @@ } } - function initWebsocket() { + function initWebSocket() { try { if (typeof MozWebSocket == 'function') WebSocket = MozWebSocket; @@ -64,7 +64,7 @@ } } - function stopWebsocket() { + function stopWebSocket() { if (websocket) websocket.close(); } @@ -94,9 +94,9 @@ break; } } - debug("Websocket state = " + websocket.readyState + " ( " + stateStr + " )"); + debug("WebSocket state = " + websocket.readyState + " ( " + stateStr + " )"); } else { - debug("Websocket is null"); + debug("WebSocket is null"); } } </script> diff --git a/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp b/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp index d407196e034725dce805332391915c294b4edcb9..a36aeac21568920e8d5614e7dc0534ab88dd17bf 100644 --- a/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp +++ b/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE -void QmlWebsocket_plugin::registerTypes(const char *uri) +void QmlWebSocket_plugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("Qt.WebSockets")); diff --git a/src/imports/qmlwebsockets/qmlwebsockets_plugin.h b/src/imports/qmlwebsockets/qmlwebsockets_plugin.h index cd663a5ae31ca1c4bedaff3da90d995f79b984a8..1cab5871300c779db6f2bd934984678595c7ffdf 100644 --- a/src/imports/qmlwebsockets/qmlwebsockets_plugin.h +++ b/src/imports/qmlwebsockets/qmlwebsockets_plugin.h @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE -class QmlWebsocket_plugin : public QQmlExtensionPlugin +class QmlWebSocket_plugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") diff --git a/src/websockets/qdefaultmaskgenerator_p.cpp b/src/websockets/qdefaultmaskgenerator_p.cpp index da166aca4ef43b3478a53a33389daf2fe761a4ac..32b3309a5d9a3b74b0260daf6022eda6c32db548 100644 --- a/src/websockets/qdefaultmaskgenerator_p.cpp +++ b/src/websockets/qdefaultmaskgenerator_p.cpp @@ -90,7 +90,7 @@ QDefaultMaskGenerator::~QDefaultMaskGenerator() \internal */ -bool QDefaultMaskGenerator::seed() +bool QDefaultMaskGenerator::seed() Q_DECL_NOEXCEPT { qsrand(static_cast<uint>(QDateTime::currentMSecsSinceEpoch())); return true; @@ -101,7 +101,7 @@ bool QDefaultMaskGenerator::seed() \internal */ -quint32 QDefaultMaskGenerator::nextMask() +quint32 QDefaultMaskGenerator::nextMask() Q_DECL_NOEXCEPT { return quint32((double(qrand()) / RAND_MAX) * std::numeric_limits<quint32>::max()); } diff --git a/src/websockets/qwebsocket.cpp b/src/websockets/qwebsocket.cpp index 825d66c984e518ac2b0876801014d219a326171b..f53d3d74ad0e267fb40f73ac6a3a865a38b43dbd 100644 --- a/src/websockets/qwebsocket.cpp +++ b/src/websockets/qwebsocket.cpp @@ -43,7 +43,7 @@ \class QWebSocket \inmodule QtWebSockets - \brief Implements a TCP socket that talks the websocket protocol. + \brief Implements a TCP socket that talks the WebSocket protocol. WebSockets is a web technology providing full-duplex communications channels over a single TCP connection. @@ -60,9 +60,9 @@ QWebSocket only supports version 13 of the WebSocket protocol, as outlined in \l {http://tools.ietf.org/html/rfc6455}{RFC 6455}. - \note Some proxies do not understand certain HTTP headers used during a web socket handshake. - In that case, non-secure web socket connections fail. The best way to mitigate against - this problem is to use web sockets over a secure connection. + \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 + this problem is to use WebSocket over a secure connection. \warning To generate masks, this implementation of WebSockets uses the cryptographically insecure qrand() function. @@ -81,11 +81,11 @@ /*! \page echoclient.html example \title QWebSocket client example - \brief A sample websocket client that sends a message and displays the message that + \brief A sample WebSocket client that sends a message and displays the message that it receives back. \section1 Description - The EchoClient example implements a web socket client that sends a message to a websocket server + The EchoClient example implements a WebSocket client that sends a message to a WebSocket server and dumps the answer that it gets back. This example should ideally be used with the EchoServer example. \section1 Code @@ -166,7 +166,7 @@ not been filled in with new information when the signal returns. This signal is emitted every time a payload of data has been written to the socket. The \a bytes argument is set to the number of bytes that were written in this payload. - \note This signal has the same meaning both for secure and non-secure websockets. + \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()). \sa close() @@ -388,7 +388,7 @@ void QWebSocket::close(QWebSocketProtocol::CloseCode closeCode, const QString &r } /*! - \brief Opens a websocket connection using the given \a url. + \brief Opens a WebSocket connection using the given \a url. If the url contains newline characters (\\r\\n), then the error signal will be emitted with QAbstractSocket::ConnectionRefusedError as error type. diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index fb6486e88b60df040045760367b4cd212efdafcd..18962fff05a4c4c1f873ac6dfd25f12eb16d2f98 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -440,7 +440,7 @@ void QWebSocketPrivate::open(const QUrl &url, bool mask) } } else { const QString message = - QWebSocket::tr("Unsupported websockets scheme: %1").arg(url.scheme()); + QWebSocket::tr("Unsupported WebSocket scheme: %1").arg(url.scheme()); setErrorString(message); Q_EMIT q->error(QAbstractSocket::UnsupportedSocketOperationError); } @@ -463,7 +463,7 @@ void QWebSocketPrivate::ping(const QByteArray &payload) /*! \internal - Sets the version to use for the websocket protocol; + Sets the version to use for the WebSocket protocol; this must be set before the socket is opened. */ void QWebSocketPrivate::setVersion(QWebSocketProtocol::Version version) @@ -887,21 +887,21 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) const QStringList headerField = headerLine.split(QStringLiteral(": "), QString::SkipEmptyParts); if (headerField.size() == 2) { - headers.insertMulti(headerField[0], headerField[1]); + headers.insertMulti(headerField[0].toLower(), headerField[1]); } headerLine = readLine(pSocket); } - const QString acceptKey = headers.value(QStringLiteral("Sec-WebSocket-Accept"), + const QString acceptKey = headers.value(QStringLiteral("sec-websocket-accept"), QString()); - const QString upgrade = headers.value(QStringLiteral("Upgrade"), QString()); - const QString connection = headers.value(QStringLiteral("Connection"), QString()); + const QString upgrade = headers.value(QStringLiteral("upgrade"), QString()); + const QString connection = headers.value(QStringLiteral("connection"), QString()); // unused for the moment -// const QString extensions = headers.value(QStringLiteral("Sec-WebSocket-Extensions"), +// const QString extensions = headers.value(QStringLiteral("sec-websocket-extensions"), // QString()); -// const QString protocol = headers.value(QStringLiteral("Sec-WebSocket-Protocol"), +// const QString protocol = headers.value(QStringLiteral("sec-websocket-protocol"), // QString()); - const QString version = headers.value(QStringLiteral("Sec-WebSocket-Version"), + const QString version = headers.value(QStringLiteral("sec-websocket-version"), QString()); if (Q_LIKELY(httpStatusCode == 101)) { diff --git a/src/websockets/qwebsocketdataprocessor.cpp b/src/websockets/qwebsocketdataprocessor.cpp index db9aa886c83e94666d3035975c5045bf9fa72740..83a1a268373b23054c3b79e409c097ab423b8937 100644 --- a/src/websockets/qwebsocketdataprocessor.cpp +++ b/src/websockets/qwebsocketdataprocessor.cpp @@ -41,7 +41,7 @@ /*! \class QWebSocketDataProcessor The class QWebSocketDataProcessor is responsible for reading, validating and - interpreting data from a websocket. + interpreting data from a WebSocket. It reads data from a QIODevice, validates it against RFC 6455, and parses it into frames (data, control). It emits signals that correspond to the type of the frame: textFrameReceived(), diff --git a/src/websockets/qwebsocketframe.cpp b/src/websockets/qwebsocketframe.cpp index 431710c6239d3fc1c811ad2e8bdc67261caa76f6..e48308fe3377bba07d81f39f1eab7c257aefd4e8 100644 --- a/src/websockets/qwebsocketframe.cpp +++ b/src/websockets/qwebsocketframe.cpp @@ -42,7 +42,7 @@ /*! \class QWebSocketFrame The class QWebSocketFrame is responsible for reading, validating and - interpreting frames from a websocket. + interpreting frames from a WebSocket. It reads data from a QIODevice, validates it against RFC 6455, and parses it into a frame (data, control). Whenever an error is detected, isValid() returns false. @@ -336,7 +336,7 @@ QWebSocketFrame QWebSocketFrame::readFrame(QIODevice *pIoDevice) switch (processingState) { case PS_WAIT_FOR_MORE_DATA: //TODO: waitForReadyRead should really be changed - //now, when a websocket is used in a GUI thread + //now, when a WebSocket is used in a GUI thread //the GUI will hang for at most 5 seconds //maybe, a QStateMachine should be used if (!pIoDevice->waitForReadyRead(5000)) { diff --git a/src/websockets/qwebsocketprotocol.cpp b/src/websockets/qwebsocketprotocol.cpp index a5e45c4deceb91e0af897435f8d84ecb7f893c83..46a84ec94d2fd81aba7f480c44ac510b6050429f 100644 --- a/src/websockets/qwebsocketprotocol.cpp +++ b/src/websockets/qwebsocketprotocol.cpp @@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE \inmodule QtWebSockets - \brief The different defined versions of the Websocket protocol. + \brief The different defined versions of the WebSocket protocol. For an overview of the differences between the different protocols, see <http://code.google.com/p/pywebsocket/wiki/WebSocketProtocolSpec> @@ -162,7 +162,7 @@ QT_BEGIN_NAMESPACE /*! \fn QWebSocketProtocol::isCloseCodeValid(int closeCode) - Checks if \a closeCode is a valid web socket close code + Checks if \a closeCode is a valid WebSocket close code \internal */ diff --git a/src/websockets/qwebsocketserver.cpp b/src/websockets/qwebsocketserver.cpp index 58c3cc9db57998b687a53527b8884e81c6cbb468..20aa009c6f2debe88dd10869f6b7c0968e5fce8c 100644 --- a/src/websockets/qwebsocketserver.cpp +++ b/src/websockets/qwebsocketserver.cpp @@ -44,11 +44,11 @@ \inmodule QtWebSockets - \brief Implements a websocket-based server. + \brief Implements a WebSocket-based server. It is modeled after QTcpServer, and behaves the same. So, if you know how to use QTcpServer, you know how to use QWebSocketServer. - This class makes it possible to accept incoming websocket connections. + This class makes it possible to accept incoming WebSocket connections. You can specify the port or have QWebSocketServer pick one automatically. You can listen on a specific address or on all the machine's addresses. Call listen() to have the server listen for incoming connections. @@ -72,9 +72,9 @@ \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 - 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 + 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. @@ -85,10 +85,10 @@ /*! \page echoserver.html example \title WebSocket server example - \brief A sample websocket server echoing back messages sent to it. + \brief A sample WebSocket server echoing back messages sent to it. \section1 Description - The echoserver example implements a web socket server that echoes back everything that is sent + The echoserver example implements a WebSocket server that echoes back everything that is sent to it. \section1 Code We start by creating a QWebSocketServer (`new QWebSocketServer()`). After the creation, we listen @@ -96,7 +96,7 @@ \snippet echoserver/echoserver.cpp constructor If listening is successful, we connect the `newConnection()` signal to the slot `onNewConnection()`. - The `newConnection()` signal will be thrown whenever a new web socket client is connected to our + The `newConnection()` signal will be thrown whenever a new WebSocket client is connected to our server. \snippet echoserver/echoserver.cpp onNewConnection @@ -128,7 +128,7 @@ /*! \fn void QWebSocketServer::serverError(QWebSocketProtocol::CloseCode closeCode) - This signal is emitted when an error occurs during the setup of a web socket connection. + This signal is emitted when an error occurs during the setup of a WebSocket connection. The \a closeCode parameter describes the type of error that occurred \sa errorString() @@ -503,7 +503,7 @@ quint16 QWebSocketServer::serverPort() const QWebSocketServer will emit the error() signal with the QWebSocketProtocol::CloseCodeAbnormalDisconnection close code when the maximum of connections has been reached. - The websocket handshake will fail and the socket will be closed. + The WebSocket handshake will fail and the socket will be closed. \sa maxPendingConnections(), hasPendingConnections() */ @@ -543,7 +543,7 @@ int QWebSocketServer::socketDescriptor() const } /*! - Returns a list of websocket versions that this server is supporting. + Returns a list of WebSocket versions that this server is supporting. */ QList<QWebSocketProtocol::Version> QWebSocketServer::supportedVersions() const { diff --git a/src/websockets/qwebsocketserver_p.cpp b/src/websockets/qwebsocketserver_p.cpp index f349dc26556b81d950193c5985ae6e3af6bed6b6..70bc5da74d4fcb6499a270d7b2a36e7c798af1b7 100644 --- a/src/websockets/qwebsocketserver_p.cpp +++ b/src/websockets/qwebsocketserver_p.cpp @@ -435,7 +435,7 @@ void QWebSocketServerPrivate::handshakeReceived() pTcpSocket->close(); pTcpSocket->deleteLater(); qWarning() << QWebSocketServer::tr("Too many pending connections: " \ - "New websocket connection not accepted."); + "New WebSocket connection not accepted."); setError(QWebSocketProtocol::CloseCodeAbnormalDisconnection, QWebSocketServer::tr("Too many pending connections.")); return; @@ -471,7 +471,7 @@ void QWebSocketServerPrivate::handshakeReceived() success = true; } else { setError(QWebSocketProtocol::CloseCodeAbnormalDisconnection, - QWebSocketServer::tr("Upgrading to websocket failed.")); + QWebSocketServer::tr("Upgrade to WebSocket failed.")); } } else { diff --git a/tests/auto/handshakerequest/tst_handshakerequest.cpp b/tests/auto/handshakerequest/tst_handshakerequest.cpp index 4302e13c3334fd1167cba7013cf1dbc486273053..e4dbf0580790f321aa46d09796bb703c77912ec9 100644 --- a/tests/auto/handshakerequest/tst_handshakerequest.cpp +++ b/tests/auto/handshakerequest/tst_handshakerequest.cpp @@ -159,14 +159,14 @@ void tst_HandshakeRequest::tst_invalidStream_data() //this test checks if there doesn't occur an out-of-bounds exception QTest::newRow("Correctly formatted but invalid short fields") << QStringLiteral("V R P"); QTest::newRow("Invalid \\0 character in header") << QStringLiteral("V R\0 P"); - QTest::newRow("Invalid http version in header") << QStringLiteral("V R HTTP/invalid"); + QTest::newRow("Invalid HTTP version in header") << QStringLiteral("V R HTTP/invalid"); QTest::newRow("Empty header field") << QStringLiteral("GET . HTTP/1.1\r\nHEADER: "); QTest::newRow("All zeros") << QString::fromUtf8(QByteArray(10, char(0))); QTest::newRow("Invalid hostname") << QStringLiteral("GET . HTTP/1.1\r\nHost: \xFF\xFF"); //doing extensive QStringLiteral concatenations here, because //MSVC 2010 complains when using concatenation literal strings about //concatenation of wide and narrow strings (error C2308) - QTest::newRow("Complete header - Invalid websocket version") + QTest::newRow("Complete header - Invalid WebSocket version") << QStringLiteral("GET . HTTP/1.1\r\nHost: foo\r\nSec-WebSocket-Version: ") + QStringLiteral("\xFF\xFF\r\n") + QStringLiteral("Sec-WebSocket-Key: AVDFBDDFF\r\n") + @@ -177,7 +177,7 @@ void tst_HandshakeRequest::tst_invalidStream_data() QStringLiteral("Sec-WebSocket-Key: AVDFBDDFF\r\n") + QStringLiteral("Upgrade: websocket\r\n") + QStringLiteral("Connection: Upgrade\r\n\r\n"); - QTest::newRow("Complete header - Invalid http version") + QTest::newRow("Complete header - Invalid HTTP version") << QStringLiteral("GET . HTTP/a.1\r\nHost: foo\r\nSec-WebSocket-Version: 13\r\n") + QStringLiteral("Sec-WebSocket-Key: AVDFBDDFF\r\n") + QStringLiteral("Upgrade: websocket\r\n") +