public Cancellable cancellable { get; set; }
protected SourceFunc run_continue;
+ private int _priority = -1;
+ protected int priority {
+ get {
+ if (this._priority != -1) {
+ return this._priority;
+ }
+
+ var mode = this.msg.request_headers.get_one
+ ("transferMode.dlna.org");
+
+ if (mode == null || mode == "Interactive") {
+ this._priority = Priority.DEFAULT;
+ } else if (mode == "Streaming") {
+ this._priority = Priority.HIGH;
+ } else if (mode == "Background") {
+ this._priority = Priority.LOW;
+ } else {
+ this._priority = Priority.DEFAULT;
+ }
+
+ return _priority;
+ }
+ }
public HTTPResponse (Soup.Server server,
Soup.Message msg,
private uint8[] buffer;
private size_t total_length;
- int priority;
-
public HTTPSeekableResponse (Soup.Server server,
Soup.Message msg,
string uri,
base (server, msg, partial, cancellable);
this.seek = seek;
- this.priority = this.get_requested_priority ();
this.total_length = (size_t) seek.length;
this.buffer = new uint8[HTTPSeekableResponse.BUFFER_LENGTH];
this.end (false, Soup.KnownStatusCode.NONE);
}
}
-
- private int get_requested_priority () {
- var mode = this.msg.request_headers.get_one ("transferMode.dlna.org");
-
- if (mode == null || mode == "Interactive") {
- return Priority.DEFAULT;
- } else if (mode == "Streaming") {
- return Priority.HIGH;
- } else if (mode == "Background") {
- return Priority.LOW;
- } else {
- return Priority.DEFAULT;
- }
- }
}