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 --- Emby.Server.Implementations/Session/HttpSessionController.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Emby.Server.Implementations/Session/HttpSessionController.cs') diff --git a/Emby.Server.Implementations/Session/HttpSessionController.cs b/Emby.Server.Implementations/Session/HttpSessionController.cs index bd53da1bd..940c821e2 100644 --- a/Emby.Server.Implementations/Session/HttpSessionController.cs +++ b/Emby.Server.Implementations/Session/HttpSessionController.cs @@ -66,19 +66,22 @@ namespace Emby.Server.Implementations.Session return SendMessage(name, new Dictionary(), cancellationToken); } - private Task SendMessage(string name, + private async Task SendMessage(string name, Dictionary args, CancellationToken cancellationToken) { var url = PostUrl + "/" + name + ToQueryString(args); - return _httpClient.Post(new HttpRequestOptions + using ((await _httpClient.Post(new HttpRequestOptions { Url = url, CancellationToken = cancellationToken, BufferContent = false - }); + }).ConfigureAwait(false))) + { + + } } public Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken) -- cgit v1.2.3