diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-16 23:17:14 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-16 23:17:14 -0400 |
| commit | e2052c771dbc332d0e12cef5213202c0ca3adc82 (patch) | |
| tree | e5dd82bc358182bd29bcbbe74650b3ebacf6b4fe /MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs | |
| parent | 21c3430ac4001b137b35d5ed46dd6d1d59434b58 (diff) | |
added new device profiles
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index 5efb39cbc..11a5cdf08 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -107,7 +107,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager return client; } - private PropertyInfo _httpBehaviorPropertyInfo; private WebRequest GetRequest(HttpRequestOptions options, string method, bool enableHttpCompression) { var request = (HttpWebRequest)WebRequest.Create(options.Url); @@ -118,7 +117,11 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); - request.KeepAlive = options.EnableKeepAlive; + if (options.EnableKeepAlive) + { + request.KeepAlive = true; + } + request.Method = method; request.Pipelined = true; request.Timeout = 20000; @@ -133,21 +136,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager request.Referer = options.Referer; } -#if !__MonoCS__ - if (options.EnableKeepAlive) - { - // This is a hack to prevent KeepAlive from getting disabled internally by the HttpWebRequest - // May need to remove this for mono - var sp = request.ServicePoint; - if (_httpBehaviorPropertyInfo == null) - { - _httpBehaviorPropertyInfo = sp.GetType().GetProperty("HttpBehaviour", BindingFlags.Instance | BindingFlags.NonPublic); - } - - _httpBehaviorPropertyInfo.SetValue(sp, (byte)0, null); - } -#endif - return request; } |
