From 4f673eac7495cf6ce6520bcbf6901a4ba60e6bb5 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 3 Oct 2017 16:32:15 +0200 Subject: [PATCH] [System.Net.Http] Updates range check from 3741d16503a973a99c724bdab9a255a5f07a3637 --- mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs | 2 +- .../System.Net.Http/Test/System.Net.Http/HttpClientTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs index c9fd2354abe..3880d418dca 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs @@ -96,7 +96,7 @@ namespace System.Net.Http return timeout; } set { - if (value != System.Threading.Timeout.InfiniteTimeSpan && (value <= TimeSpan.Zero || value.Ticks > int.MaxValue)) + if (value != System.Threading.Timeout.InfiniteTimeSpan && (value <= TimeSpan.Zero || value.TotalMilliseconds > int.MaxValue)) throw new ArgumentOutOfRangeException (); timeout = value; diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index c87bb7562a1..c51ba6818ba 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -316,7 +316,7 @@ namespace MonoTests.System.Net.Http } try { - client.Timeout = new TimeSpan(int.MaxValue + 1L); + client.Timeout = TimeSpan.FromMilliseconds (int.MaxValue + 1L); Assert.Fail ("#3"); } catch (ArgumentOutOfRangeException) { } -- 2.25.1