projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[System.Net.Http] HttpClient timeout range checks. Fixes #25755
[mono.git]
/
mcs
/
class
/
System.Net.Http
/
System.Net.Http
/
HttpClient.cs
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 114e78e83c2a53037594ccfbdbc1e458879ea10e..c9fd2354abe136be56708c73b9a2bf30ff6f2098 100644
(file)
--- a/
mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs
+++ b/
mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs
@@
-33,7
+33,7
@@
using System.IO;
namespace System.Net.Http
{
namespace System.Net.Http
{
- public class HttpClient : HttpMessageInvoker
+ public
partial
class HttpClient : HttpMessageInvoker
{
static readonly TimeSpan TimeoutDefault = TimeSpan.FromSeconds (100);
{
static readonly TimeSpan TimeoutDefault = TimeSpan.FromSeconds (100);
@@
-44,10
+44,12
@@
namespace System.Net.Http
long buffer_size;
TimeSpan timeout;
long buffer_size;
TimeSpan timeout;
+#if !XAMARIN_MODERN
public HttpClient ()
: this (new HttpClientHandler (), true)
{
}
public HttpClient ()
: this (new HttpClientHandler (), true)
{
}
+#endif
public HttpClient (HttpMessageHandler handler)
: this (handler, true)
public HttpClient (HttpMessageHandler handler)
: this (handler, true)
@@
-94,7
+96,7
@@
namespace System.Net.Http
return timeout;
}
set {
return timeout;
}
set {
- if (value != System.Threading.Timeout.InfiniteTimeSpan &&
value < TimeSpan.Zero
)
+ if (value != System.Threading.Timeout.InfiniteTimeSpan &&
(value <= TimeSpan.Zero || value.Ticks > int.MaxValue)
)
throw new ArgumentOutOfRangeException ();
timeout = value;
throw new ArgumentOutOfRangeException ();
timeout = value;