diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-02 22:30:24 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-02 22:30:24 -0400 |
| commit | 60d1d5cdee642ee9d5be7e91be5caeb9a1a756df (patch) | |
| tree | 67dcd2270977afafc596a1c4568cdaa4cf9d26dc /MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs | |
| parent | a3d553a7fbe93fe416c940e80d5e511a2d753f25 (diff) | |
restore nuget targets for mono build
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs | 12 |
1 files changed, 11 insertions, 1 deletions
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<long, long, long> ThrottleCallback { get; set; } + public Action OnComplete { get; set; } /// <summary> /// Initializes a new instance of the <see cref="StreamWriter" /> 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(); + } + } } } } |
