mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-28 04:52:18 +00:00
convert static remote streaming to use internal interfaces
This commit is contained in:
parent
eec9e04825
commit
be1ce0f802
9 changed files with 114 additions and 90 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue