aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-20 12:16:56 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-20 12:16:56 -0400
commit060215143ff62e4cf475a493e57c8607beca8640 (patch)
tree1d1095525a83bb8183184db952d28556bc05f323 /Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
parent86226ff97c7d6dc4005c3bb1978861e948de1e20 (diff)
improve httpclient resource disposal
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs')
-rw-r--r--Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs62
1 files changed, 0 insertions, 62 deletions
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,40 +279,10 @@ namespace Emby.Server.Implementations.HttpClientManager
public async Task<Stream> Get(HttpRequestOptions options)
{
var response = await GetResponse(options).ConfigureAwait(false);
-
return response.Content;
}
/// <summary>
- /// Performs a GET request and returns the resulting stream
- /// </summary>
- /// <param name="url">The URL.</param>
- /// <param name="resourcePool">The resource pool.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{Stream}.</returns>
- public Task<Stream> Get(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken)
- {
- return Get(new HttpRequestOptions
- {
- Url = url,
- ResourcePool = resourcePool,
- CancellationToken = cancellationToken,
- BufferContent = resourcePool != null
- });
- }
-
- /// <summary>
- /// Gets the specified URL.
- /// </summary>
- /// <param name="url">The URL.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{Stream}.</returns>
- public Task<Stream> Get(string url, CancellationToken cancellationToken)
- {
- return Get(url, null, cancellationToken);
- }
-
- /// <summary>
/// send as an asynchronous operation.
/// </summary>
/// <param name="options">The options.</param>
@@ -590,26 +560,6 @@ namespace Emby.Server.Implementations.HttpClientManager
}
/// <summary>
- /// Performs a POST request
- /// </summary>
- /// <param name="url">The URL.</param>
- /// <param name="postData">Params to add to the POST data.</param>
- /// <param name="resourcePool">The resource pool.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>stream on success, null on failure</returns>
- public Task<Stream> Post(string url, Dictionary<string, string> postData, SemaphoreSlim resourcePool, CancellationToken cancellationToken)
- {
- return Post(new HttpRequestOptions
- {
- Url = url,
- ResourcePool = resourcePool,
- CancellationToken = cancellationToken,
- BufferContent = resourcePool != null
-
- }, postData);
- }
-
- /// <summary>
/// Downloads the contents of a given url into a temporary location
/// </summary>
/// <param name="options">The options.</param>
@@ -891,18 +841,6 @@ namespace Emby.Server.Implementations.HttpClientManager
}
}
- /// <summary>
- /// Posts the specified URL.
- /// </summary>
- /// <param name="url">The URL.</param>
- /// <param name="postData">The post data.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{Stream}.</returns>
- public Task<Stream> Post(string url, Dictionary<string, string> postData, CancellationToken cancellationToken)
- {
- return Post(url, postData, null, cancellationToken);
- }
-
private Task<WebResponse> GetResponseAsync(WebRequest request, TimeSpan timeout)
{
var taskCompletion = new TaskCompletionSource<WebResponse>();