From 060215143ff62e4cf475a493e57c8607beca8640 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 20 Oct 2017 12:16:56 -0400 Subject: improve httpclient resource disposal --- .../HttpClientManager/HttpClientManager.cs | 62 ---------------------- 1 file changed, 62 deletions(-) (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs') diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs index fe545ecff..3fdd05135 100644 --- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs @@ -279,39 +279,9 @@ namespace Emby.Server.Implementations.HttpClientManager public async Task Get(HttpRequestOptions options) { var response = await GetResponse(options).ConfigureAwait(false); - return response.Content; } - /// - /// Performs a GET request and returns the resulting stream - /// - /// The URL. - /// The resource pool. - /// The cancellation token. - /// Task{Stream}. - public Task Get(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken) - { - return Get(new HttpRequestOptions - { - Url = url, - ResourcePool = resourcePool, - CancellationToken = cancellationToken, - BufferContent = resourcePool != null - }); - } - - /// - /// Gets the specified URL. - /// - /// The URL. - /// The cancellation token. - /// Task{Stream}. - public Task Get(string url, CancellationToken cancellationToken) - { - return Get(url, null, cancellationToken); - } - /// /// send as an asynchronous operation. /// @@ -589,26 +559,6 @@ namespace Emby.Server.Implementations.HttpClientManager return response.Content; } - /// - /// Performs a POST request - /// - /// The URL. - /// Params to add to the POST data. - /// The resource pool. - /// The cancellation token. - /// stream on success, null on failure - public Task Post(string url, Dictionary postData, SemaphoreSlim resourcePool, CancellationToken cancellationToken) - { - return Post(new HttpRequestOptions - { - Url = url, - ResourcePool = resourcePool, - CancellationToken = cancellationToken, - BufferContent = resourcePool != null - - }, postData); - } - /// /// Downloads the contents of a given url into a temporary location /// @@ -891,18 +841,6 @@ namespace Emby.Server.Implementations.HttpClientManager } } - /// - /// Posts the specified URL. - /// - /// The URL. - /// The post data. - /// The cancellation token. - /// Task{Stream}. - public Task Post(string url, Dictionary postData, CancellationToken cancellationToken) - { - return Post(url, postData, null, cancellationToken); - } - private Task GetResponseAsync(WebRequest request, TimeSpan timeout) { var taskCompletion = new TaskCompletionSource(); -- cgit v1.2.3