From 9cbcf5063c3af350d385f1992017f6883f37a8e0 Mon Sep 17 00:00:00 2001 From: elupus Date: Sun, 22 May 2011 17:21:57 +0200 Subject: fixed: upnp server's http server would not provide content length on HEAD requests --- lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/libUPnP') diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp index 67c8923296..25df3d600b 100644 --- a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp +++ b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp @@ -249,9 +249,7 @@ PLT_HttpServerSocketTask::Write(NPT_HttpResponse* response, NPT_HttpEntity* entity = response->GetEntity(); NPT_InputStreamReference body_stream; - if (entity && - NPT_SUCCEEDED(entity->GetInputStream(body_stream)) && - !body_stream.IsNull()) { + if (entity) { if (entity->HasContentLength()) { // content length headers.SetHeader(NPT_HTTP_HEADER_CONTENT_LENGTH, @@ -288,7 +286,7 @@ PLT_HttpServerSocketTask::Write(NPT_HttpResponse* response, NPT_CHECK_WARNING(output_stream->WriteFully(header_stream.GetData(), header_stream.GetDataSize())); // send response body if any - if (!headers_only && !body_stream.IsNull()) { + if (!headers_only && NPT_SUCCEEDED(entity->GetInputStream(body_stream)) && !body_stream.IsNull()) { NPT_CHECK_WARNING(NPT_StreamToStreamCopy( *body_stream.AsPointer(), *output_stream.AsPointer(), -- cgit v1.2.3