From 48f8a0cf237e757d1ef3f8be424f7a1acb915b0c Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 13 Feb 2015 10:11:37 +0100 Subject: Doc: add description and image for echoclient html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7e2adaf19d15842f914be6f946f30d09b7b5532f Reviewed-by: Topi Reiniƶ --- src/websockets/doc/qtwebsockets.qdocconf | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/websockets/doc/qtwebsockets.qdocconf b/src/websockets/doc/qtwebsockets.qdocconf index 3f87cef..ed95343 100644 --- a/src/websockets/doc/qtwebsockets.qdocconf +++ b/src/websockets/doc/qtwebsockets.qdocconf @@ -50,6 +50,10 @@ sourcedirs += .. \ exampledirs += ../../../examples/websockets \ snippets +examples.fileextensions += "*.html" + +imagedirs += ../../../examples/websockets/doc/images + manifestmeta.thumbnail.names += "QtWebSockets/*" navigation.landingpage = "Qt WebSockets" -- cgit v1.2.1 From e0521c794bd1a4325d0c59e8f75aa263efa671d5 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 19 Jan 2015 12:28:52 +0100 Subject: Doc: added qmake to dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib38445f8bf67e3bfe81f5d2d1a30f7b429f30ac5 Task-number: QTBUG-43810 Reviewed-by: Martin Smith Reviewed-by: Topi Reiniƶ --- src/websockets/doc/qtwebsockets.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/websockets/doc/qtwebsockets.qdocconf b/src/websockets/doc/qtwebsockets.qdocconf index ed95343..2e1e15b 100644 --- a/src/websockets/doc/qtwebsockets.qdocconf +++ b/src/websockets/doc/qtwebsockets.qdocconf @@ -37,7 +37,7 @@ qhp.QtWebSockets.subprojects.examples.sortPages = true tagfile = ../../../doc/qtwebsockets/qtwebsockets.tags -depends += qtcore qtnetwork qtdoc +depends += qtcore qtnetwork qtdoc qmake headerdirs += .. \ ../../imports -- cgit v1.2.1 From 0a42c6aff61142f97b6288b4504357a26ef43855 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 10 Feb 2015 09:19:54 +0100 Subject: Fix keyword for Origin In RFC 6455(v13), the correct keyword is Origin. Task-number: QTBUG-44310 Change-Id: I009f079e01e213eb232b0dfc1a441305f3d9e588 Reviewed-by: Kurt Pattyn Reviewed-by: Oswald Buddenhagen --- src/websockets/qwebsockethandshakerequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/websockets/qwebsockethandshakerequest.cpp b/src/websockets/qwebsockethandshakerequest.cpp index 2476a81..94d99cd 100644 --- a/src/websockets/qwebsockethandshakerequest.cpp +++ b/src/websockets/qwebsockethandshakerequest.cpp @@ -260,7 +260,7 @@ void QWebSocketHandshakeRequest::readHandshake(QTextStream &textStream) connectionValues << (*c).trimmed(); //optional headers - m_origin = m_headers.value(QStringLiteral("sec-websocket-origin"), QString()); + m_origin = m_headers.value(QStringLiteral("origin"), QString()); const QStringList protocolLines = m_headers.values(QStringLiteral("sec-websocket-protocol")); for (QStringList::const_iterator pl = protocolLines.begin(); pl != protocolLines.end(); ++pl) { QStringList protocols = (*pl).split(QStringLiteral(","), QString::SkipEmptyParts); -- cgit v1.2.1 From 85a8ea105646c7d871f982b890ef5f6faa91824d Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 19 Feb 2015 14:03:45 +0100 Subject: fix the port in Host field in handshake request Task-number: QTBUG-39355 Change-Id: I06993193fe9618ace93552aed573a3eee5de18fa Reviewed-by: Oswald Buddenhagen Reviewed-by: Kurt Pattyn --- src/websockets/qwebsockethandshakerequest.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/websockets/qwebsockethandshakerequest.cpp b/src/websockets/qwebsockethandshakerequest.cpp index 94d99cd..6c8c9cf 100644 --- a/src/websockets/qwebsockethandshakerequest.cpp +++ b/src/websockets/qwebsockethandshakerequest.cpp @@ -222,10 +222,22 @@ void QWebSocketHandshakeRequest::readHandshake(QTextStream &textStream) headerLine = textStream.readLine(); } - const QString host = m_headers.value(QStringLiteral("host"), QString()); m_requestUrl = QUrl::fromEncoded(resourceName.toLatin1()); - if (m_requestUrl.isRelative()) + QString host = m_headers.value(QStringLiteral("host"), QString()); + if (m_requestUrl.isRelative()) { + // see http://tools.ietf.org/html/rfc6455#page-17 + // No. 4 item in "The requirements for this handshake" + int idx = host.indexOf(":"); + bool ok = false; + int port; + if (idx != -1) { + port = host.rightRef(host.length() - idx - 1).toInt(&ok); + host.truncate(idx); + } m_requestUrl.setHost(host); + if (ok) + m_requestUrl.setPort(port); + } if (m_requestUrl.scheme().isEmpty()) { const QString scheme = isSecure() ? QStringLiteral("wss") : QStringLiteral("ws"); m_requestUrl.setScheme(scheme); -- cgit v1.2.1