Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pleilleur opened this issue Dec 12, 2023 · 0 comments

Comments

@pleilleur
Copy link

pleilleur commented Dec 12, 2023

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 ?

@pleilleur pleilleur changed the title Calculation of field MaxTimeout of type TimeSpan in HttpClient doesn't match Timespan definition of MaxValue. Calculation of field Timeout of type TimeSpan in HttpClient doesn't match Timespan definition of MaxValue. Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant