[rygel] server: Add missing Content-Length header
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] server: Add missing Content-Length header
- Date: Tue, 13 Nov 2012 15:19:11 +0000 (UTC)
commit 3ca45a38334a98fbf17839a1206bb6363783a9b4
Author: Jens Georg <jensg openismus com>
Date: Mon Nov 12 23:23:03 2012 +0100
server: Add missing Content-Length header
More fall-out from that seeking bugfix. Caused seek in player not to work as
well as missing length information for several file types.
src/librygel-server/rygel-http-get.vala | 2 +-
.../rygel-http-identity-handler.vala | 5 +++++
2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-server/rygel-http-get.vala b/src/librygel-server/rygel-http-get.vala
index a6ea908..a63768b 100644
--- a/src/librygel-server/rygel-http-get.vala
+++ b/src/librygel-server/rygel-http-get.vala
@@ -164,7 +164,7 @@ internal class Rygel.HTTPGet : HTTPRequest {
this.msg.set_status (Soup.KnownStatusCode.OK);
}
- if (this.seek != null && this.seek is HTTPByteSeek) {
+ if (this.handler is HTTPIdentityHandler) {
this.msg.response_headers.set_encoding (Soup.Encoding.CONTENT_LENGTH);
} else {
this.msg.response_headers.set_encoding (Soup.Encoding.EOF);
diff --git a/src/librygel-server/rygel-http-identity-handler.vala b/src/librygel-server/rygel-http-identity-handler.vala
index 7c779b5..a3e13d7 100644
--- a/src/librygel-server/rygel-http-identity-handler.vala
+++ b/src/librygel-server/rygel-http-identity-handler.vala
@@ -47,6 +47,11 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler {
if (request.seek != null) {
request.seek.add_response_headers ();
+ } else {
+ if (request.item.size > 0) {
+ request.msg.response_headers.set_content_length
+ (request.item.size);
+ }
}
// Chain-up
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]