THRIFT-4919 THttpTransport.cs (netstd) and THttpClientTransport (netcore) have bad timeout code

Patch: Jens Geyer

This closes #1847
This commit is contained in:
Jens Geyer 2019-08-19 23:41:49 +02:00
parent 26ef904600
commit 9cf37be1f1
2 changed files with 3 additions and 2 deletions

View File

@ -63,6 +63,7 @@ namespace Thrift.Transports.Client
public int ConnectTimeout
{
set { _connectTimeout = value; }
get { return _connectTimeout; }
}
public override bool IsOpen => true;
@ -145,7 +146,7 @@ namespace Thrift.Transports.Client
if (_connectTimeout > 0)
{
httpClient.Timeout = TimeSpan.FromSeconds(_connectTimeout);
httpClient.Timeout = TimeSpan.FromMilliseconds(_connectTimeout);
}
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-thrift"));

View File

@ -145,7 +145,7 @@ namespace Thrift.Transport.Client
if (_connectTimeout > 0)
{
httpClient.Timeout = TimeSpan.FromSeconds(_connectTimeout);
httpClient.Timeout = TimeSpan.FromMilliseconds(_connectTimeout);
}
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-thrift"));