|
|
@@ -811,7 +811,7 @@ namespace System.Net
|
|
|
asyncWrite = (WebAsyncResult) asyncResult;
|
|
|
}
|
|
|
|
|
|
- if (!asyncResult.AsyncWaitHandle.WaitOne (timeout, false)) {
|
|
|
+ if (!asyncResult.IsCompleted && !asyncResult.AsyncWaitHandle.WaitOne (timeout, false)) {
|
|
|
Abort ();
|
|
|
throw new WebException ("The request timed out", WebExceptionStatus.Timeout);
|
|
|
}
|
|
|
@@ -907,6 +907,11 @@ namespace System.Net
|
|
|
public override WebResponse GetResponse()
|
|
|
{
|
|
|
WebAsyncResult result = (WebAsyncResult) BeginGetResponse (null, null);
|
|
|
+ if (!result.IsCompleted && !result.AsyncWaitHandle.WaitOne (timeout, false)) {
|
|
|
+ Abort ();
|
|
|
+ throw new WebException ("The request timed out", WebExceptionStatus.Timeout);
|
|
|
+ }
|
|
|
+
|
|
|
return EndGetResponse (result);
|
|
|
}
|
|
|
|