[rygel] renderer: Work-around peers not supporting HEAD
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] renderer: Work-around peers not supporting HEAD
- Date: Tue, 7 May 2013 21:51:44 +0000 (UTC)
commit 769bd7e922e60c71a31535ec921cd438c0d6934b
Author: Jens Georg <jensg openismus com>
Date: Tue May 7 23:49:33 2013 +0200
renderer: Work-around peers not supporting HEAD
If a peer does not support HEAD, fall back to GET and cancel the message after
the got_headers signal so we basically fake a HEAD request and only if that
fails, fail completely.
src/librygel-renderer/rygel-av-transport.vala | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/src/librygel-renderer/rygel-av-transport.vala b/src/librygel-renderer/rygel-av-transport.vala
index c5df54d..b6d970f 100644
--- a/src/librygel-renderer/rygel-av-transport.vala
+++ b/src/librygel-renderer/rygel-av-transport.vala
@@ -247,18 +247,15 @@ internal class Rygel.AVTransport : Service {
message.request_headers.append ("getContentFeatures.dlna.org",
"1");
message.finished.connect ((msg) => {
- // Server does not support HEAD request
- if (msg.status_code == KnownStatusCode.BAD_REQUEST ||
- msg.status_code == KnownStatusCode.MALFORMED) {
- action.return ();
-
- // FIXME: no chance to check for playlists.
- this.controller.metadata = _metadata;
- this.controller.uri = _uri;
- this.controller.n_tracks = 1;
- this.controller.track = 1;
- this.track_metadata = _metadata;
- this.track_uri = _uri;
+ if (msg.status_code != KnownStatusCode.OK &&
+ msg.method == "HEAD") {
+ debug ("Peer does not support HEAD, trying GET");
+ msg.method = "GET";
+ msg.got_headers.connect ((msg) => {
+ this.session.cancel_message (msg, msg.status_code);
+ });
+
+ this.session.queue_message (msg, null);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]