[Mono-bugs] [Bug 698675] Can not make repeated POST requests with HttpWebRequest

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 9 17:55:01 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=698675

https://bugzilla.novell.com/show_bug.cgi?id=698675#c4


Geoff Norton <grompf at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |grompf at gmail.com

--- Comment #4 from Geoff Norton <grompf at gmail.com> 2011-08-09 21:55:00 UTC ---
The issue here is a combination of 2 issues, one is a behavioural difference
with MS.net, the other is a bug.

If you look at the implementation of the server it does:

do {
} while (stream.Read (buffer, 0, buffer.Length) == buffer.Length);

This code assumes that the buffer will be read in its entirety every time,
which is not in fact true.  The stream could return < buffer.Lenght, but still
have more reading to be done.  This caused the server to write its response,
and then close the socket.

On the client side, the request was still being written even tho the server had
hung up, which could cause a ECONNRESET, which would percolate up into all the
errors.

If one modifies the server to read the entire dummy buffer the errors go away. 
 Its worth noting that the MS.NET client running against this server does not
have errors, so we need to handle this condition gracefully.  Its possible
their client isn't doing any chunking which would allow our server to work?  I
havn't dug much further than that yet.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list