aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/HttpClientManager
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager')
-rw-r--r--MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
index 6c673d206..ca18442a8 100644
--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
@@ -131,6 +131,16 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
await options.ResourcePool.WaitAsync(options.CancellationToken).ConfigureAwait(false);
}
+ if ((DateTime.UtcNow - client.LastTimeout).TotalSeconds < 30)
+ {
+ if (options.ResourcePool != null)
+ {
+ options.ResourcePool.Release();
+ }
+
+ throw new HttpException(string.Format("Connection to {0} timed out", options.Url)) { IsTimedOut = true };
+ }
+
_logger.Info("HttpClientManager.Get url: {0}", options.Url);
try