From 60d1d5cdee642ee9d5be7e91be5caeb9a1a756df Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 2 Sep 2014 22:30:24 -0400 Subject: restore nuget targets for mono build --- .../HttpServer/StreamWriter.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs') diff --git a/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs b/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs index 28fc094f7..1ca5f1204 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs @@ -39,6 +39,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer public bool Throttle { get; set; } public long ThrottleLimit { get; set; } public long MinThrottlePosition; + public Func ThrottleCallback { get; set; } + public Action OnComplete { get; set; } /// /// Initializes a new instance of the class. @@ -85,7 +87,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer { responseStream = new ThrottledStream(responseStream, ThrottleLimit) { - MinThrottlePosition = MinThrottlePosition + MinThrottlePosition = MinThrottlePosition, + ThrottleCallback = ThrottleCallback }; } var task = WriteToAsync(responseStream); @@ -113,6 +116,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer throw; } + finally + { + if (OnComplete != null) + { + OnComplete(); + } + } } } } -- cgit v1.2.3