[Mono-bugs] [Bug 62871][Nor] New - Using HttpWebRequest to POST via a Proxy while disabling AllowWriteStreamBuffering may throw exceptions

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 11 Aug 2004 12:50:03 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by adam@battleaxe.net.

http://bugzilla.ximian.com/show_bug.cgi?id=62871

--- shadow/62871	2004-08-11 12:50:03.000000000 -0400
+++ shadow/62871.tmp.22910	2004-08-11 12:50:03.000000000 -0400
@@ -0,0 +1,105 @@
+Bug#: 62871
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: Debian Unstable
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: adam@battleaxe.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Using HttpWebRequest to POST via a Proxy while disabling AllowWriteStreamBuffering may throw exceptions
+
+Description of Problem:
+
+When using HttpWebRequest to POST, and setting AllowWriteStreamBuffering to
+false, the first attempt succeeds but subsequent attempts may throw an
+exception.
+
+
+Steps to reproduce the problem:
+1. Create HttpWebRequest
+2. Set request to use Proxy
+3. Set AllowWriteStreamBuffering = false
+4. Get Response Stream
+5. Repeat steps 1 through 4
+
+Actual Results:
+(See test case attached for code to recreate)
+
+Getting Request Stream
+Writing POST data
+Close Stream Writer
+Get Response
+Received Response
+************
+Getting Request Stream
+Writing POST data
+Close Stream Writer
+Exception:
+EndWrite failure
+in <0x0009e> System.Net.Sockets.NetworkStream:EndWrite (System.IAsyncResult)
+in <0x0001a> System.Net.WebConnection:EndWrite (System.IAsyncResult)
+in <0x000fe> System.Net.WebConnectionStream:EndWrite (System.IAsyncResult)
+in <0x00070> System.Net.WebConnectionStream:Write (byte[],int,int)
+in <0x0006c> System.IO.StreamWriter:FlushBytes ()
+in <0x0004a> (wrapper remoting-invoke-with-check)
+System.IO.StreamWriter:FlushBytes ()
+in <0x00052> System.IO.StreamWriter:Flush ()
+in <0x00024> System.IO.StreamWriter:Dispose (bool)
+in <0x00017> System.IO.StreamWriter:Close ()
+in <0x00246> X:Main (string[])
+
+************
+Getting Request Stream
+Writing POST data
+Close Stream Writer
+Get Response
+Received Response
+************
+Getting Request Stream
+Writing POST data
+Close Stream Writer
+Get Response
+Received Response
+************
+Getting Request Stream
+Writing POST data
+Close Stream Writer
+Exception:
+EndWrite failure
+in <0x0009e> System.Net.Sockets.NetworkStream:EndWrite (System.IAsyncResult)
+in <0x0001a> System.Net.WebConnection:EndWrite (System.IAsyncResult)
+in <0x000fe> System.Net.WebConnectionStream:EndWrite (System.IAsyncResult)
+in <0x00070> System.Net.WebConnectionStream:Write (byte[],int,int)
+in <0x0006c> System.IO.StreamWriter:FlushBytes ()
+in <0x0004a> (wrapper remoting-invoke-with-check)
+System.IO.StreamWriter:FlushBytes ()
+in <0x00052> System.IO.StreamWriter:Flush ()
+in <0x00024> System.IO.StreamWriter:Dispose (bool)
+in <0x00017> System.IO.StreamWriter:Close ()
+in <0x00246> X:Main (string[])
+
+************
+
+
+Expected Results:
+
+No exceptions
+
+How often does this happen? 
+
+Out of 5 attempted POSTs per test, the first, third, and fourth always
+succeed, while the second and fifth always throw the exception.
+
+Additional Information:
+
+To test this, I used TinyProxy, a small non-caching proxy server.
+This doesn't throw exceptions if AllowWriteBuffering is set to true (its
+default) or if you aren't using a proxy.