microsoft/referencesource

Calculation of field Timeout of type TimeSpan in HttpClient doesn't match Timespan definition of MaxValue.

pleilleur opened this issue · 0 comments

https://github.com/microsoft/referencesource/blame/51cf7850defa8a17d815b4700b67116e3fa283c2/System/net/System/Net/Http/HttpClient.cs#L14

Timespan.MaxValue is calculated using long.MaxValue, while HttpClient uses int.MaxValue to define the HttpClient.Timeout value. This results in an exception when user tries to initialize a Timeout based on TimeSpan.MaxValue.

As HttpClient.TimeOut uses TimeSpan format, shouldn't it use the same scope of values ?