diff options
author | elupus <elupus@xbmc.org> | 2011-05-22 17:21:57 +0200 |
---|---|---|
committer | elupus <elupus@xbmc.org> | 2011-05-22 17:24:23 +0200 |
commit | 9cbcf5063c3af350d385f1992017f6883f37a8e0 (patch) | |
tree | bd0cc61e6038b28a5486fe360f300988f2f79977 /lib/libUPnP | |
parent | 239ccf2ed8eea371dfd3e9631debe839a792101a (diff) |
fixed: upnp server's http server would not provide content length on HEAD requests
Diffstat (limited to 'lib/libUPnP')
-rw-r--r-- | lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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(), |