* WebConnectionStream.cs: when receiving a 0 content-length, free up
the slot for the next request immediately.
Fixes bug #427974.
svn path=/trunk/mcs/; revision=113610
* WebConnectionStream.cs (WriteRequest): For small requests,
cluster together the header + body in a single write call, avoids
the latency problems observed in an TLS application that makes
many web service calls.
2008-08-22 Geoff Norton <[email protected]>
* WebConnection.cs: Set NoDelay
svn path=/trunk/mcs/; revision=111430
* HttpWebRequest.cs: send the request if ContentLength is set for
POST/PUT, the request stream has that exact amount of bytes in it and
we're trying to get the response stream.
This way, closing the request stream is not needed in order to actually
send the request. Fixes bug #77753.
* WebConnectionStream.cs: throw if the number of bytes written is
greater than the specified request content length.
svn path=/trunk/mcs/; revision=57920
* WebConnectionStream.cs: initiate writing the body before trying to
read. This fixes the performance problems observed in web services.
Closes bug #75455.
svn path=/trunk/mcs/; revision=46896
* WebConnection.cs: if cnc.EndRead throws, mark the asyncresult as done.
* WebConnectionStream.cs: if we're done with the body of a chunk, don't
require the next chunk header to be there, as some servers might close
the connection (while also sending 'Connection: close').
svn path=/trunk/mcs/; revision=46512
* WebConnection.cs:
* HttpWebRequest.cs:
* WebConnectionStream.cs: initiate the polling for input data after
sending the header so that we detect any response that the server sends
back even if we're still trying to write the request for a POST/PUT.
If we get the response (or an error) before any one calls GetResponse(),
keep it around instead of ignoring it.
svn path=/trunk/mcs/; revision=45785
* WebConnection.cs: removed a 'slightly' important line by mistake.
* WebConnectionStream.cs: if the transfer encoding is chunked, ignore
content-length header if present.
svn path=/trunk/mcs/; revision=43952
* WebConnection.cs: no need to use an AutoResetEvent.
* WebConnectionStream.cs: don't start any more reads on the socket
after getting a 0 signalling the end. This fixes Ben's infamous foo.cs
test.
svn path=/trunk/mcs/; revision=43916
* WebConnectionStream.cs: if the BeginRead/BeginWrite is completed
synchronously, no need to create the ManualResetEvent to wait on.
svn path=/trunk/mcs/; revision=43178
* WebConnectionStream.cs:
* WebAsyncResult.cs: ensure we only call EndRead once per async. result.
Update total before invoking the callback when present.
svn path=/trunk/mcs/; revision=43016
* WebConnection.cs:
* WebConnectionStream.cs: don't start reading until we've sent at least
the headers. This way we ensure that a Write happens before any Read,
which is needed by the SSL code.
svn path=/trunk/mcs/; revision=42792
* WebConnectionStream.cs: provide a default callback when doing async.
read/write and waiting for a timeout so that the callback sets the
event and we don't block forever. Fixes bug #74539 take 3.
svn path=/trunk/mcs/; revision=42773
* WebConnection.cs: fix some breakage from my last patch.
* WebConnectionStream.cs: invoke the callback when done even in EndRead.
svn path=/trunk/mcs/; revision=42768
* WebConnection.cs: if we're reading chunked data and didn't use the
stream to read, we gotta set the async. result as complete and invoke
the callback. Don't call nstream.EndRead with the wrong IAsyncResult.
* WebConnectionStream.cs: in EndRead, pass the correct IAsyncResult to
cnc.EndRead. Lock on a field instead of 'this'.
svn path=/trunk/mcs/; revision=42750
* WebConnectionStream.cs: ForceCompletion actually calls NextRead. No
need to wait for a Close/ReadAll when we have no content.
svn path=/trunk/mcs/; revision=42650
* HttpWebRequest.cs: send the headers when we're supposed to write
a POST/PUT but call GetResponse before GetRequestStream.
* WebConnectionStream.cs: new RequestWritten property.
svn path=/trunk/mcs/; revision=40127
* WebConnection.cs: remove prevStream and don't set busy to false in
HandleError. prevStream is not needed any more and setting 'busy' so
early might let a request skip the queue.
* WebConnectionGroup.cs: decrement the indexer when removing a dead
reference from the arraylist.
* WebConnectionStream.cs:
(ReadAll): call NextRead if it has not been called before even when
we have completed the request. Reuse the read buffer when reading a
response of unknown size. Increase the buffer to 8kB.
(BeginRead): increase pendingReads earlier and even when reading from
the internal buffer.
(EndRead): decrease pendingReads later and always.
svn path=/trunk/mcs/; revision=36993
* ChunkStream.cs:
(WantMore): we're not done until we get a 0 chunk size and the trailer.
The 0 can be expressed as more than one character too (ie, 000000).
* HttpWebRequest.cs: new argument in SetResponseError.
* WebConnection.cs: added argument to HandleError as a hint for
debugging.
(Connect): make the chunked stream be in the expected state when
reusing.
* WebConnectionStream.cs: removed unused method (ResetWriteBuffer).
svn path=/trunk/mcs/; revision=35312
* Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs: get
an HttpWebRequest so that we can use the ServicePoint it has. No
need to get the host now.
* System/System.Net/WebConnection.cs: moved loading of the ssl stream
Type to its own method. Don't create a new ssl stream if we're reusing
the connection.
* System/System.Net/WebConnectionStream.cs: ensure the number of bytes
copied in ReadAll is the expected even if the dta from the server has
extra bytes.
Partial fix for bug #61218. Still problems with POST.
svn path=/trunk/mcs/; revision=31134
* debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
when no HOME env. variable was set and a NullRef was thrown in a .cctor
called from other .cctors.
svn path=/trunk/mcs/; revision=31024
* ServicePoint.cs: SendContinue is always false for HTTP/1.0
* WebConnection.cs: get rid of WaitForContinue() (yes!) and prevent
calling more the ContinueDelegate more than once when we get the
headers in several packets.
* WebConnectionStream.cs: removed call to WaitForContinue.
svn path=/trunk/mcs/; revision=23477
* HttpWebRequest.cs: send the 'Connection: keep-alive' header when we
don't know the server version or it's 1.0.
* ServicePoint.cs: added SetVersion.
* WebAsyncResult.cs: remove ChunkAsyncResult.
* WebConnection.cs: set the ServicePoint version when getting a response
from the server.
* WebConnectionStream.cs: when posting chunked content, send the head,
body and trailer of the chunk at once instead of doing 3 separate
writes, which may cause troubles.
svn path=/trunk/mcs/; revision=23223
* WebConnection.cs: if we get a 100 when we're not waiting for it, set
that information in the ServicePoint.
* WebConnectionStream.cs: send headers in the right order for
non-chunked POST.
svn path=/trunk/mcs/; revision=23204
* HttpWebRequest.cs: on second and sucesive tries when authenticating,
don't use chunked encoding for POST, as we know the content length and
have the body. Nullify bodyBuffer always in CheckFinalStatus.
* WebAsyncResult.cs: added ChunkAsyncResult property. It holds the
IAsyncResult when writing CRLF at the end of a chunk.
* WebConnectionStream.cs: support sending chunked data.
svn path=/trunk/mcs/; revision=23153
failure, resend the body. This fixes bug #51841.
* WebConnectionStream.cs: Added properties for getting what's been written.
svn path=/trunk/mcs/; revision=23121
* WebConnection.cs: Data.Init is a bad boy. Lluis realized. He also
tidied up the end of ReadDone. Disabled relaunching the request if 2
InitRead are called, since now we don't throw everything into
RegisterWaitForSingleObject but one request at a time.
* WebConnectionGroup.cs: when checking available connections, allow them
not to be Connected but allocated to honor the connection limit.
* WebConnectionStream.cs: CheckComplete() now checks for nextReadCalled
too. ReadAll don't mess contentLength if it's provided in the headers.
BIG thanks to Lluis. Turns out that we were debugging the same stuff and
his Data.Init discovery was THE thing I was missing.
Fixes bug #51277.
svn path=/trunk/mcs/; revision=21883
* WebConnection.cs: turns out that socket.Connected is not useful until
we actually try to send/receive data, even if the other end has already
closed the socket. Added TryReconnect() and Connected.
* WebConnectionData.cs: default value for StatusCode is 0 now.
* WebConnectionGroup.cs: reuse the connection since the beginning,
instead of opening up to ConnectionLimit and then reusing.
* WebConnectionStream.cs: reopen the socket if we're trying to reuse
one which fails on first write.
svn path=/trunk/mcs/; revision=20117
* WebConnectionStream.cs: when a callback is passed to BeginRead/Write,
wrap it and do our job before calling it. Fixes bug #48497.
svn path=/trunk/mcs/; revision=19985