diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-13 11:38:43 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-13 11:38:43 -0500 |
| commit | be1ce0f80275a1718dc89dd65e2919e9eab8eb7b (patch) | |
| tree | 68dc8095701f4b8c45a073c46f4097827e6627c3 /MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs | |
| parent | eec9e0482525c400e9dc7cb17bc000434adba105 (diff) | |
convert static remote streaming to use internal interfaces
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index a5b241b4b..a49a0a0db 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -276,6 +276,26 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager { options.CancellationToken.ThrowIfCancellationRequested(); + if (!options.BufferContent) + { + var response = await httpWebRequest.GetResponseAsync().ConfigureAwait(false); + + var httpResponse = (HttpWebResponse)response; + + EnsureSuccessStatusCode(httpResponse); + + options.CancellationToken.ThrowIfCancellationRequested(); + + return new HttpResponseInfo + { + Content = httpResponse.GetResponseStream(), + + StatusCode = httpResponse.StatusCode, + + ContentType = httpResponse.ContentType + }; + } + using (var response = await httpWebRequest.GetResponseAsync().ConfigureAwait(false)) { var httpResponse = (HttpWebResponse)response; |
