Author: gonzalo
Date: 2005-04-16 17:41:05 -0400 (Sat, 16 Apr 2005)
New Revision: 43129
Modified:
trunk/mcs/class/System/System.Net/ChangeLog
trunk/mcs/class/System/System.Net/WebAsyncResult.cs
trunk/mcs/class/System/System.Net/WebConnectionStream.cs
Log:
2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* WebConnectionStream.cs: call SetComplete in EndWrite when we're not
buffering the request body. Fixes bug #74673.
* WebAsyncResult.cs: renamed field.
Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2005-04-16 20:27:03 UTC (rev
43128)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2005-04-16 21:41:05 UTC (rev
43129)
@@ -1,3 +1,10 @@
+2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * WebConnectionStream.cs: call SetComplete in EndWrite when we're not
+ buffering the request body. Fixes bug #74673.
+
+ * WebAsyncResult.cs: renamed field.
+
2005-04-14 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* WebConnectionStream.cs:
Modified: trunk/mcs/class/System/System.Net/WebAsyncResult.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebAsyncResult.cs 2005-04-16 20:27:03 UTC
(rev 43128)
+++ trunk/mcs/class/System/System.Net/WebAsyncResult.cs 2005-04-16 21:41:05 UTC
(rev 43129)
@@ -51,7 +51,7 @@
int offset;
int size;
object locker = new object ();
- public bool EndReadCalled;
+ public bool EndCalled;
public WebAsyncResult (AsyncCallback cb, object state)
{
Modified: trunk/mcs/class/System/System.Net/WebConnectionStream.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebConnectionStream.cs 2005-04-16
20:27:03 UTC (rev 43128)
+++ trunk/mcs/class/System/System.Net/WebConnectionStream.cs 2005-04-16
21:41:05 UTC (rev 43129)
@@ -294,12 +294,12 @@
public override int EndRead (IAsyncResult r)
{
WebAsyncResult result = (WebAsyncResult) r;
- if (result.EndReadCalled) {
+ if (result.EndCalled) {
int xx = result.NBytes;
return (xx >= 0) ? xx : 0;
}
- result.EndReadCalled = true;
+ result.EndCalled = true;
if (!result.IsCompleted) {
int nbytes = cnc.EndRead (result);
@@ -386,17 +386,23 @@
if (r == null)
throw new ArgumentNullException ("r");
- if (allowBuffering && !sendChunked)
- return;
-
WebAsyncResult result = r as WebAsyncResult;
if (result == null)
throw new ArgumentException ("Invalid
IAsyncResult");
+ if (result.EndCalled)
+ return;
+
+ result.EndCalled = true;
+
+ if (allowBuffering && !sendChunked)
+ return;
+
if (result.GotException)
throw result.Exception;
cnc.EndWrite (result.InnerAsyncResult);
+ result.SetCompleted (false, 0);
if (sendChunked) {
lock (locker) {
pendingWrites--;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches