+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:
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);
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--;