Skip to content

Commit

Permalink
[UPnP] reinstated: 'fixed: upnp server's http server would not provid…
Browse files Browse the repository at this point in the history
…e content length on HEAD requests' by elupus @ 9cbcf50
  • Loading branch information
alcoheca committed Sep 5, 2012
1 parent 038e436 commit 05e7dcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
Expand Up @@ -279,7 +279,7 @@ PLT_HttpServerSocketTask::Write(NPT_HttpResponse* response,
// get the request entity to set additional headers
NPT_InputStreamReference body_stream;
NPT_HttpEntity* entity = response->GetEntity();
if (entity && NPT_SUCCEEDED(entity->GetInputStream(body_stream))) {
if (entity) {
// set the content length if known
if (entity->ContentLengthIsKnown()) {
headers.SetHeader(NPT_HTTP_HEADER_CONTENT_LENGTH,
Expand Down Expand Up @@ -341,7 +341,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(),
Expand Down

0 comments on commit 05e7dcb

Please sign in to comment.