aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common.Implementations')
-rw-r--r--MediaBrowser.Common.Implementations/BaseApplicationPaths.cs3
-rw-r--r--MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs9
-rw-r--r--MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj21
3 files changed, 16 insertions, 17 deletions
diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs
index ba68d1f5a..6acaac5c9 100644
--- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs
+++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs
@@ -280,8 +280,7 @@ namespace MediaBrowser.Common.Implementations
// If it's a relative path, e.g. "..\"
if (!Path.IsPathRooted(programDataPath))
{
- var path = Assembly.GetExecutingAssembly().Location;
- path = Path.GetDirectoryName(path);
+ var path = Path.GetDirectoryName(ApplicationPath);
if (string.IsNullOrEmpty(path))
{
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
index 214ed106d..19091885d 100644
--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
@@ -103,21 +103,24 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
private WebRequest GetMonoRequest(HttpRequestOptions options, string method, bool enableHttpCompression)
{
- var request = WebRequest.Create(options.Url);
+ var request = (HttpWebRequest)WebRequest.Create(options.Url);
if (!string.IsNullOrEmpty(options.AcceptHeader))
{
- request.Headers.Add("Accept", options.AcceptHeader);
+ request.Accept = options.AcceptHeader;
}
+ request.AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None;
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.Revalidate);
request.ConnectionGroupName = GetHostFromUrl(options.Url);
+ request.KeepAlive = true;
request.Method = method;
+ request.Pipelined = true;
request.Timeout = 20000;
if (!string.IsNullOrEmpty(options.UserAgent))
{
- request.Headers.Add("User-Agent", options.UserAgent);
+ request.UserAgent = options.UserAgent;
}
return request;
diff --git a/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj b/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj
index 948785575..f990db556 100644
--- a/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj
+++ b/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj
@@ -37,21 +37,9 @@
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
- <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\NLog.2.1.0\lib\net45\NLog.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Text, Version=3.9.70.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.Text.3.9.70\lib\net35\ServiceStack.Text.dll</HintPath>
- </Reference>
<Reference Include="SharpCompress">
<HintPath>..\packages\sharpcompress.0.10.1.3\lib\net40\SharpCompress.dll</HintPath>
</Reference>
- <Reference Include="SimpleInjector, Version=2.3.6.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\SimpleInjector.2.3.6\lib\net40-client\SimpleInjector.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
@@ -59,6 +47,15 @@
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
+ <Reference Include="NLog">
+ <HintPath>..\packages\NLog.2.1.0\lib\net45\NLog.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Text">
+ <HintPath>..\packages\ServiceStack.Text.3.9.70\lib\net35\ServiceStack.Text.dll</HintPath>
+ </Reference>
+ <Reference Include="SimpleInjector">
+ <HintPath>..\packages\SimpleInjector.2.3.6\lib\net40-client\SimpleInjector.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">