aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-08-29 08:14:41 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-08-29 08:14:41 -0400
commit6a9dbf6ae85b4e7abcf06f7f29ef9d8b0b890876 (patch)
tree562525930bef52e56ec03295f3b3ed401e8b34aa /MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs
parent7dc9c2b77f7bde8f1f383d8cfc98b06e2487ad4d (diff)
update translations
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs b/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs
index 2e2f5e9f8..5fd43aa76 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs
@@ -24,6 +24,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
private long RangeLength { get; set; }
private long TotalContentLength { get; set; }
+ public bool Throttle { get; set; }
+ public long ThrottleLimit { get; set; }
+
/// <summary>
/// The _options
/// </summary>
@@ -159,6 +162,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <param name="responseStream">The response stream.</param>
public void WriteTo(Stream responseStream)
{
+ if (Throttle)
+ {
+ responseStream = new ThrottledStream(responseStream, ThrottleLimit)
+ {
+ MinThrottlePosition = ThrottleLimit * 180
+ };
+ }
var task = WriteToAsync(responseStream);
Task.WaitAll(task);