1 From e332ca20095fccfea9478650120c37f03fb500fd Mon Sep 17 00:00:00 2001
2 From: Alasdair Campbell <alcoheca@gmail.com>
3 Date: Wed, 6 Jun 2012 18:02:16 +0100
4 Subject: [PATCH 03/21] [UPnP] reinstated: 'fixed: upnp server's http server
5 would not provide content length on HEAD requests' by
6 elupus @ 9cbcf5063c3af350d385f1992017f6883f37a8e0
9 lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp | 4 ++--
10 1 file changed, 2 insertions(+), 2 deletions(-)
12 diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
13 index 11a7ac0..7ffed7e 100644
14 --- a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
15 +++ b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
16 @@ -279,7 +279,7 @@ PLT_HttpServerSocketTask::Write(NPT_HttpResponse* response,
17 // get the request entity to set additional headers
18 NPT_InputStreamReference body_stream;
19 NPT_HttpEntity* entity = response->GetEntity();
20 - if (entity && NPT_SUCCEEDED(entity->GetInputStream(body_stream))) {
22 // set the content length if known
23 if (entity->ContentLengthIsKnown()) {
24 headers.SetHeader(NPT_HTTP_HEADER_CONTENT_LENGTH,
25 @@ -341,7 +341,7 @@ PLT_HttpServerSocketTask::Write(NPT_HttpResponse* response,
26 NPT_CHECK_WARNING(output_stream->WriteFully(header_stream.GetData(), header_stream.GetDataSize()));
28 // send response body if any
29 - if (!headers_only && !body_stream.IsNull()) {
30 + if (!headers_only && NPT_SUCCEEDED(entity->GetInputStream(body_stream)) && !body_stream.IsNull()) {
31 NPT_CHECK_WARNING(NPT_StreamToStreamCopy(
32 *body_stream.AsPointer(),
33 *output_stream.AsPointer(),