Bläddra i källkod

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.


svn path=/trunk/mcs/; revision=43129
Gonzalo Paniagua Javier 21 år sedan
förälder
incheckning
1be9ca7a33

+ 7 - 0
mcs/class/System/System.Net/ChangeLog

@@ -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:

+ 1 - 1
mcs/class/System/System.Net/WebAsyncResult.cs

@@ -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)
 		{

+ 11 - 5
mcs/class/System/System.Net/WebConnectionStream.cs

@@ -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--;