convert static remote streaming to use internal interfaces

This commit is contained in:
Luke Pulverenti
2014-02-13 11:38:43 -05:00
parent eec9e04825
commit be1ce0f802
9 changed files with 114 additions and 90 deletions

View File

@@ -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;