Merge pull request #4314 from MartijnKaijser/beta1
[vuplus_xbmc] / lib / libUPnP / patches / 0004-UPnP-reinstated-fixed-upnp-server-s-http-server-woul.patch
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
7
8 ---
9  lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp | 4 ++--
10  1 file changed, 2 insertions(+), 2 deletions(-)
11
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))) {
21 +    if (entity) {
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()));
27  
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(),
34 -- 
35 1.7.11.msysgit.0
36