From 032bb13a8e631af9aaa0ed0e871fdc1d5dc28ce7 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 31 Mar 2014 21:47:50 +0200 Subject: [PATCH 1/3] libsystemd-qt: Fix the build depends of this recipe --- recipes-qt/libsystemd-qt/libsystemd-qt_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-qt/libsystemd-qt/libsystemd-qt_git.bb b/recipes-qt/libsystemd-qt/libsystemd-qt_git.bb index 1bfcd780e9..2e9131597f 100644 --- a/recipes-qt/libsystemd-qt/libsystemd-qt_git.bb +++ b/recipes-qt/libsystemd-qt/libsystemd-qt_git.bb @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e6a600fd5e1d9cbde2d983680233ad02" inherit cmake_qt5 -DEPENDS = "systemd" +DEPENDS += "systemd qtbase" RDEPENDS_${PN} = "dbus" PV = "208+git${SRCPV}" From d81ab13268488a21555a3b755279ba009af71cc9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 31 Mar 2014 21:48:04 +0200 Subject: [PATCH 2/3] tufao1: Fix the build depends of this recipe --- recipes-qt/tufao/tufao1_1.0.2.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-qt/tufao/tufao1_1.0.2.bb b/recipes-qt/tufao/tufao1_1.0.2.bb index 8fea0218f7..6e87bf018c 100644 --- a/recipes-qt/tufao/tufao1_1.0.2.bb +++ b/recipes-qt/tufao/tufao1_1.0.2.bb @@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c" inherit cmake_qt5 +DEPENDS += "qtbase" + SRC_URI = "git://github.com/vinipsmaker/tufao;branch=master \ file://hardcode_paths.patch \ file://qt_sysroot.patch " From 5cd79448e4b5a730922c0c63161a5b2ee5f0b344 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 31 Mar 2014 21:49:22 +0200 Subject: [PATCH 3/3] tufao1: Fix 204 No Content producing a Message Body bug This has been reported upstream as https://github.com/vinipsmaker/tufao/issues/41 --- .../tufao/files/fix-204-no-content.patch | 119 ++++++++++++++++++ recipes-qt/tufao/tufao1_1.0.2.bb | 3 +- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 recipes-qt/tufao/files/fix-204-no-content.patch diff --git a/recipes-qt/tufao/files/fix-204-no-content.patch b/recipes-qt/tufao/files/fix-204-no-content.patch new file mode 100644 index 0000000000..abe2139318 --- /dev/null +++ b/recipes-qt/tufao/files/fix-204-no-content.patch @@ -0,0 +1,119 @@ +From ea73dadcce8dc958aebde7d4bc0d438d71c46aa2 Mon Sep 17 00:00:00 2001 +From: Holger Hans Peter Freyther +Date: Mon, 31 Mar 2014 21:42:29 +0200 +Subject: [PATCH] response: No message-body should be sent on a 204 No Content + +According to the RFC2616 no message-body should be sent when +the response code 204 is used. When using keep-alive the .NET +stack will break on response parsing after the next request. + +Add some hacks to not generate chunked-encoding in the answer +and provide a content-length. The code could use some more +re-use and the question is what should happen when ::write() +or ::end() with data is used on a 204.. +--- + src/httpserverresponse.cpp | 19 ++++++++++++++++--- + src/priv/httpserverresponse.h | 1 + + 2 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/src/httpserverresponse.cpp b/src/httpserverresponse.cpp +index f6e6617..2f87180 100644 +--- a/src/httpserverresponse.cpp ++++ b/src/httpserverresponse.cpp +@@ -139,6 +139,7 @@ bool HttpServerResponse::writeHead(int statusCode, const QByteArray &reasonPhras + priv->device.write(reasonPhrase); + priv->device.write(CRLF); + priv->formattingState = Priv::HEADERS; ++ priv->responseStatus = statusCode; + return true; + } + +@@ -182,6 +183,7 @@ bool HttpServerResponse::writeHead(HttpResponseStatus statusCode, + priv->device.write(CRLF); + } + priv->formattingState = Priv::HEADERS; ++ priv->responseStatus = int(statusCode); + return true; + } + +@@ -203,6 +205,7 @@ bool HttpServerResponse::writeHead(HttpResponseStatus statusCode) + priv->device.write(reasonPhrase(statusCode)); + priv->device.write(CRLF); + priv->formattingState = Priv::HEADERS; ++ priv->responseStatus = int(statusCode); + return true; + } + +@@ -211,6 +214,10 @@ bool HttpServerResponse::write(const QByteArray &chunk) + if (!chunk.size()) + return false; + ++ /* Bad?! At least write the headers? */ ++ if (priv->responseStatus == int(HttpResponseStatus::NO_CONTENT) && chunk.size()) ++ return false; ++ + if (priv->options.testFlag(HttpServerResponse::HTTP_1_0)) { + switch (priv->formattingState) { + case Priv::STATUS_LINE: +@@ -241,6 +248,7 @@ bool HttpServerResponse::write(const QByteArray &chunk) + QByteArray::fromRawData(value, + sizeof(value) - 1)); + } ++ + priv->headers.insert("Transfer-Encoding", "chunked"); + + for (Headers::iterator i = priv->headers.begin() +@@ -346,7 +354,9 @@ bool HttpServerResponse::end(const QByteArray &chunk) + - 1)); + } + } +- { ++ if (priv->responseStatus == int(HttpResponseStatus::NO_CONTENT)) ++ priv->headers.insert("Content-Length", "0"); ++ else { + static const char key[] = "Transfer-Encoding", + value[] = "chunked"; + priv->headers.insert(QByteArray::fromRawData(key, +@@ -376,6 +386,7 @@ bool HttpServerResponse::end(const QByteArray &chunk) + } + case Priv::MESSAGE_BODY: + { ++ /* Check that no chunk has been specified for 204... */ + if (chunk.size()) { + if (priv->options.testFlag(HttpServerResponse::HTTP_1_1)) { + priv->device.write(QByteArray::number(chunk.size(), 16)); +@@ -392,7 +403,8 @@ bool HttpServerResponse::end(const QByteArray &chunk) + priv->http10Buffer.clear(); + } + if (priv->options.testFlag(HttpServerResponse::HTTP_1_1)) { +- priv->device.write(LAST_CHUNK); ++ if (priv->responseStatus != int(HttpResponseStatus::NO_CONTENT)) ++ priv->device.write(LAST_CHUNK); + priv->formattingState = Priv::TRAILERS; + } else { + priv->device.close(); +@@ -403,7 +415,8 @@ bool HttpServerResponse::end(const QByteArray &chunk) + } + case Priv::TRAILERS: + { +- priv->device.write(CRLF); ++ if (priv->responseStatus != int(HttpResponseStatus::NO_CONTENT)) ++ priv->device.write(CRLF); + if (!priv->options.testFlag(HttpServerResponse::KEEP_ALIVE)) + priv->device.close(); + +diff --git a/src/priv/httpserverresponse.h b/src/priv/httpserverresponse.h +index 2562b34..74598e6 100644 +--- a/src/priv/httpserverresponse.h ++++ b/src/priv/httpserverresponse.h +@@ -46,6 +46,7 @@ struct HttpServerResponse::Priv + QIODevice &device; + HttpResponseFormattingState formattingState; + Tufao::HttpServerResponse::Options options; ++ int responseStatus; + Headers headers; + + QByteArray http10Buffer; +-- +1.9.0 + diff --git a/recipes-qt/tufao/tufao1_1.0.2.bb b/recipes-qt/tufao/tufao1_1.0.2.bb index 6e87bf018c..b62f7db9f6 100644 --- a/recipes-qt/tufao/tufao1_1.0.2.bb +++ b/recipes-qt/tufao/tufao1_1.0.2.bb @@ -10,7 +10,8 @@ DEPENDS += "qtbase" SRC_URI = "git://github.com/vinipsmaker/tufao;branch=master \ file://hardcode_paths.patch \ - file://qt_sysroot.patch " + file://qt_sysroot.patch \ + file://fix-204-no-content.patch" S= "${WORKDIR}/git" SRCREV = "0d37027f8e7a64bc58196b963dffc72e13420c7a"