diff options
author | Alasdair Campbell <alcoheca@gmail.com> | 2012-06-06 18:02:16 +0100 |
---|---|---|
committer | Alasdair Campbell <alcoheca@gmail.com> | 2012-09-05 17:43:07 +0100 |
commit | 05e7dcb6ebeacb0dba83cb1a4a30eb6a8532d754 (patch) | |
tree | 27f713dd7462fc6aa31a5752d437260c50b1acba /lib | |
parent | 038e436f87b5438e539a9eaff91e9d470f7debee (diff) |
[UPnP] reinstated: 'fixed: upnp server's http server would not provide content length on HEAD requests' by elupus @ 9cbcf5063c3af350d385f1992017f6883f37a8e0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp index 11a7ac0ab2..7ffed7e5c9 100644 --- a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp +++ b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp @@ -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, @@ -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(), |