Commit Graph
106 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 61bbe5b41b 2008-10-08 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* ServicePoint.cs:
	* WebConnectionGroup.cs:
	* HttpWebRequest.cs:
	* WebConnectionStream.cs: reuse the same connection when doing NTLM
	authentication. Fixes bug #323375.
	Implemented support for UnsafeAuthenticatedConnectionSharing.


svn path=/trunk/mcs/; revision=115265
2008-10-08 20:16:33 +00:00
Gonzalo Paniagua Javier b67928068d 2008-09-19 Gonzalo Paniagua Javier <[email protected]>
* 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
2008-09-20 01:53:59 +00:00
Miguel de Icaza 5e52009db7 Apply patch from Atsushi Enomoto to fix #397627
svn path=/trunk/mcs/; revision=111562
2008-08-25 19:45:39 +00:00
Zoltan Varga 2efbbd2f1d 2008-08-23 Zoltan Varga <[email protected]>
* WebConnectionStream.cs (WriteRequest): Fix the copying in the
	previous patch, when bytes.Length != length.

svn path=/trunk/mcs/; revision=111456
2008-08-23 01:43:05 +00:00
Miguel de Icaza 9cc22599f0 2008-08-22 Zoltan Varga <[email protected]>
* 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
2008-08-22 21:30:31 +00:00
Gonzalo Paniagua Javier 516285ad2f 2007-07-14 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: implement the CanTimeout for 2.0. Fixes
	bug #81504.


svn path=/trunk/mcs/; revision=81997
2007-07-14 23:04:17 +00:00
Gert Driesen 049dd55113 * WebConnectionStream.cs: On read timeout, throw WebException with
status Timeout instead of IOException.

svn path=/trunk/mcs/; revision=77633
2007-05-18 12:24:36 +00:00
Gonzalo Paniagua Javier a60c59b7e2 2006-12-24 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: fix error in my last patch. Thanks to Felipe
	Almeida.


svn path=/trunk/mcs/; revision=70036
2006-12-25 05:09:15 +00:00
Gonzalo Paniagua Javier 39ce8024a4 2006-12-23 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* HttpWebRequest.cs:
	* WebConnectionStream.cs: detect errors writing headers earlier and
	avoid race that showed up with SSL. Fixes bug #80234.


svn path=/trunk/mcs/; revision=69986
2006-12-23 08:23:50 +00:00
Gonzalo Paniagua Javier f02c844aea 2006-03-16 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: avoid Begin/EndWrite when the body length is
	zero.


svn path=/trunk/mcs/; revision=58084
2006-03-16 19:26:03 +00:00
Gonzalo Paniagua Javier a9850902ba 2006-03-13 Gonzalo Paniagua Javier <[email protected]>
* 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
2006-03-13 22:57:58 +00:00
Gonzalo Paniagua Javier f84027dc3f 2005-07-03 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-07-03 23:22:51 +00:00
Gonzalo Paniagua Javier 437307379f 2005-06-26 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-06-26 05:51:18 +00:00
Gonzalo Paniagua Javier 16d1a69c18 2005-06-10 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-06-10 17:53:44 +00:00
Gonzalo Paniagua Javier aca2ff8b90 2005-05-03 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-05-03 17:25:49 +00:00
Gonzalo Paniagua Javier 780515fa29 2005-05-03 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-05-03 09:41:51 +00:00
Gonzalo Paniagua Javier 52392433ed 2005-04-17 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: if the BeginRead/BeginWrite is completed
	synchronously, no need to create the ManualResetEvent to wait on.


svn path=/trunk/mcs/; revision=43178
2005-04-17 23:07:26 +00:00
Gonzalo Paniagua Javier 90747718b0 ahoy
svn path=/trunk/mcs/; revision=43130
2005-04-16 21:44:05 +00:00
Gonzalo Paniagua Javier 1be9ca7a33 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
2005-04-16 21:41:05 +00:00
Gonzalo Paniagua Javier 127582b89e oops
svn path=/trunk/mcs/; revision=43017
2005-04-14 23:03:31 +00:00
Gonzalo Paniagua Javier d43aab1f7b 2005-04-14 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-04-14 22:40:16 +00:00
Gonzalo Paniagua Javier 89f42a88c6 2005-04-11 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-04-11 16:47:54 +00:00
Gonzalo Paniagua Javier 4bd1fc7904 2005-04-11 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-04-11 03:39:30 +00:00
Gonzalo Paniagua Javier b9e0899b38 2005-04-10 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-04-10 20:57:45 +00:00
Gonzalo Paniagua Javier e873f48a63 2005-04-10 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: 
	* WebConnectionStream.cs: implemented support for ReadWriteTimeout.


svn path=/trunk/mcs/; revision=42751
2005-04-10 06:00:03 +00:00
Gonzalo Paniagua Javier 8d53809856 2005-04-10 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-04-10 05:08:55 +00:00
Gonzalo Paniagua Javier 7b00247cb9 2005-04-07 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-04-07 19:59:25 +00:00
Gonzalo Paniagua Javier 5a767ce9e3 2005-02-12 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs:
	* WebConnection.cs:
	* HttpWebRequest.cs:
	* WebConnectionStream.cs: don't read the entire response unless the
	user requests it. Fixes bug #72443.


svn path=/trunk/mcs/; revision=40559
2005-02-12 21:54:47 +00:00
Gonzalo Paniagua Javier 2ded62faa5 2005-02-04 Gonzalo Paniagua Javier <[email protected]>
* 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
2005-02-04 12:41:33 +00:00
Gonzalo Paniagua Javier 01030dd7a0 2004-12-14 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: remove unneeded check. Write detects and
	triggers the exception now.


svn path=/trunk/mcs/; revision=37745
2004-12-14 13:32:24 +00:00
Gonzalo Paniagua Javier 31780b1e73 2004-12-10 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* WebConnectionStream.cs: removed TryReconnect. It's no longer needed.


svn path=/trunk/mcs/; revision=37587
2004-12-10 18:52:01 +00:00
Gonzalo Paniagua Javier 1683d9081f 2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-12-03 07:37:32 +00:00
Gonzalo Paniagua Javier 7f0c264c40 2004-10-25 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-10-25 21:26:55 +00:00
Gonzalo Paniagua Javier 4110f272ba 2004-07-14 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-07-14 13:52:29 +00:00
Gonzalo Paniagua Javier 7416bb8d6f 2004-07-11 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-07-12 01:37:58 +00:00
Duncan Mak 24f5ef2c44 Add MIT license to System.dll
svn path=/trunk/mcs/; revision=30054
2004-06-21 18:02:11 +00:00
Gonzalo Paniagua Javier e803963be2 2004-05-29 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: fixed CanRead property. Closes bug #59273.

svn path=/trunk/mcs/; revision=28412
2004-05-28 23:54:19 +00:00
Gonzalo Paniagua Javier 849f938123 2004-04-24 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: avoid the exception when getting the content
	length if possible.

svn path=/trunk/mcs/; revision=25912
2004-04-24 01:23:49 +00:00
Gonzalo Paniagua Javier 167ad12050 2004-02-26 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-02-26 01:35:43 +00:00
Gonzalo Paniagua Javier ed924f816b 2004-02-18 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-02-18 17:14:37 +00:00
Gonzalo Paniagua Javier 878ba57cae 2004-02-18 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-02-18 11:16:20 +00:00
Gonzalo Paniagua Javier bcd6f4d57b 2004-02-17 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: fixed nullrefs in BeginWrite/EndWrite.

svn path=/trunk/mcs/; revision=23176
2004-02-17 17:27:08 +00:00
Gonzalo Paniagua Javier 7caef67a07 2004-02-17 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-02-17 01:36:39 +00:00
Lluis Sanchez cbf03321ee * HttpWebRequest.cs: When retrying a POST request after an authentication
failure, resend the body. This fixes bug #51841.
	* WebConnectionStream.cs: Added properties for getting what's been written.

svn path=/trunk/mcs/; revision=23121
2004-02-16 10:18:23 +00:00
Nick Drochak b9ce91a104 2004-01-27 Nick Drochak <[email protected]>
* DigestClient.cs:
	* HttpWebRequest.cs:
	* IPv6Address.cs:
	* WebClient.cs:
	* WebConnection.cs:
	* WebConnectionStream.cs: Remove unused variables thus eliminating some
	build warnings.

svn path=/trunk/mcs/; revision=22538
2004-01-27 14:28:18 +00:00
Gonzalo Paniagua Javier 0a5ccb6f09 2004-01-09 Gonzalo Paniagua Javier <[email protected]>
* 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
2004-01-09 21:02:20 +00:00
Gonzalo Paniagua Javier 063eec915c 2003-11-17 Gonzalo Paniagua Javier <[email protected]>
* 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
2003-11-17 16:24:15 +00:00
Gonzalo Paniagua Javier 0fd6a488f8 2003-11-14 Gonzalo Paniagua Javier <[email protected]>
* 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
2003-11-14 03:23:07 +00:00
Gonzalo Paniagua Javier ea08a0e490 2003-09-16 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: fix by Lluis to avoid the stream being in an
	invalid state.

svn path=/trunk/mcs/; revision=18138
2003-09-16 21:49:39 +00:00
Lluis Sanchez 2c5e9239d6 * WebConnectionStream.cs: Only increment pendingReads if an asynchronous read
is really needed.

svn path=/trunk/mcs/; revision=15552
2003-06-22 19:49:26 +00:00