2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sat, 16 Apr 2005 21:41:05 +0000 (21:41 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sat, 16 Apr 2005 21:41:05 +0000 (21:41 -0000)
* WebConnectionStream.cs: call SetComplete in EndWrite when we're not
buffering the request body. Fixes bug #74673.

* WebAsyncResult.cs: renamed field.

svn path=/trunk/mcs/; revision=43129

mcs/class/System/System.Net/ChangeLog
mcs/class/System/System.Net/WebAsyncResult.cs
mcs/class/System/System.Net/WebConnectionStream.cs

index d7548a55184ba54b51749aabe769284ad57e75e1..9fd35e584867effe28aaa7fa2d42deb0d177c799 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * 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 <gonzalo@ximian.com>
 
        * WebConnectionStream.cs:
index 05a880e0fadf4a08933e388dead4224b59eb358d..7480d19ccbf314cf884ed1468697f9733655550e 100644 (file)
@@ -51,7 +51,7 @@ namespace System.Net
                int offset;
                int size;
                object locker = new object ();
-               public bool EndReadCalled;
+               public bool EndCalled;
 
                public WebAsyncResult (AsyncCallback cb, object state)
                {
index 892554126b3f838c2a1f75ccf3308775bf742230..70ec0173b2c87caf8824888e64ec657966e4bf4a 100644 (file)
@@ -294,12 +294,12 @@ namespace System.Net
                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 @@ namespace System.Net
                        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--;