Author: gonzalo
Date: 2005-04-17 19:07:26 -0400 (Sun, 17 Apr 2005)
New Revision: 43178
Modified:
trunk/mcs/class/System/System.Net/ChangeLog
trunk/mcs/class/System/System.Net/WebConnectionStream.cs
Log:
2005-04-17 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* WebConnectionStream.cs: if the BeginRead/BeginWrite is completed
synchronously, no need to create the ManualResetEvent to wait on.
Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2005-04-17 22:43:13 UTC (rev
43177)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2005-04-17 23:07:26 UTC (rev
43178)
@@ -1,3 +1,8 @@
+2005-04-17 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * WebConnectionStream.cs: if the BeginRead/BeginWrite is completed
+ synchronously, no need to create the ManualResetEvent to wait on.
+
2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* WebConnectionStream.cs: call SetComplete in EndWrite when we're not
Modified: trunk/mcs/class/System/System.Net/WebConnectionStream.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebConnectionStream.cs 2005-04-17
22:43:13 UTC (rev 43177)
+++ trunk/mcs/class/System/System.Net/WebConnectionStream.cs 2005-04-17
23:07:26 UTC (rev 43178)
@@ -232,7 +232,7 @@
AsyncCallback cb = new AsyncCallback
(ReadCallbackWrapper);
WebAsyncResult res = (WebAsyncResult) BeginRead
(buffer, offset, size, cb, null);
- if (!res.WaitUntilComplete (request.ReadWriteTimeout,
false)) {
+ if (!res.IsCompleted && !res.WaitUntilComplete
(request.ReadWriteTimeout, false)) {
cnc.Close (true);
throw new IOException ("Read timed out.");
}
@@ -424,7 +424,7 @@
AsyncCallback cb = new AsyncCallback
(WriteCallbackWrapper);
WebAsyncResult res = (WebAsyncResult) BeginWrite
(buffer, offset, size, cb, null);
- if (!res.WaitUntilComplete (request.ReadWriteTimeout,
false)) {
+ if (!res.IsCompleted && !res.WaitUntilComplete
(request.ReadWriteTimeout, false)) {
cnc.Close (true);
throw new IOException ("Write timed out.");
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches