Commit Graph
71 Commits
Author SHA1 Message Date
Dick Porter d4402975ad 2007-06-28 Chris Howie <[email protected]>
* ServicePoint.cs: Implemented BindIPEndPointDelegate.
	* FtpWebRequest.cs: Respect ServicePoint.BindIPEndPointDelegate.
	* WebConnection.cs: Respect ServicePoint.BindIPEndPointDelegate.

2007-06-28  Chris Howie  <[email protected]>

	* ServicePointTest.cs: Add some loose tests for
	ServicePoint.BindIPEndPointDelegate.


svn path=/trunk/mcs/; revision=83666
2007-08-08 13:14:21 +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
Andrew Skiba 118ad65016 TARGET_JVM
svn path=/trunk/mcs/; revision=66044
2006-09-28 14:52:26 +00:00
Marek Safar f55d328a2f Warnings.
svn path=/trunk/mcs/; revision=65836
2006-09-23 18:43:01 +00:00
Sebastien Pouliot 5325269d42 2006-09-11 Sebastien Pouliot <[email protected]>
* WebConnection.cs: Patch to remove the hack that was required for 
	using the older versions of the SSL/TLS classes. This hack is no more
	required :-). Patch by Gonzalo Paniagua Javier.


svn path=/trunk/mcs/; revision=65260
2006-09-11 22:56:49 +00:00
Gonzalo Paniagua Javier 64fcf30fe3 2006-04-27 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: reset the challenge and the status code when
	creating the tunnel and sending the proxy auth. headers. Improve error
	message when there's an error creating the tunnel.
	* HttpWebRequest.cs: don't trigger an early throw for a POST that gets
	a 401 or 407 response.


svn path=/trunk/mcs/; revision=60022
2006-04-28 00:48:41 +00:00
Gonzalo Paniagua Javier 2b452afac5 2006-04-26 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionData.cs:
	* WebConnection.cs:
	* HttpWebRequest.cs: when tunneling an ssl conneciton through a proxy,
	we were not handling a proxy authentication request. Fixes bug #78150
	take 2.


svn path=/trunk/mcs/; revision=59952
2006-04-26 21:16:16 +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 70760cf7b6 2005-06-21 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: SslClientStream.BeginRead might not be asynchronous
	if there's no record available to read. This is a workaround that makes
	the call to BeginRead itself asynchronous. Fixes bug #75342.


svn path=/trunk/mcs/; revision=46332
2005-06-21 21:57:20 +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 c24f3607eb 2005-05-23 Gonzalo Paniagua Javier <[email protected]>
* System.Net/WebConnection.cs: prevent 2 nullrefs when the aborting
	during Connect() and reset the status to Success before starting a
	new request.

	* System.Net.Sockets/Socket.cs: apply the same hack on blocking Connect
	calls as the one used in Accept.

	Fixes bug #75025.


svn path=/trunk/mcs/; revision=44919
2005-05-23 21:26:23 +00:00
Gonzalo Paniagua Javier c71dc63c74 2005-05-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: don't rethrow errors in Write, as the error will be
	received by GetResponse*. The result is that the threadpool thread doing
	this will not end up printing the exception. Fixes bug #74817.


svn path=/trunk/mcs/; revision=44008
2005-05-04 07:54:21 +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 5c48037452 leftover
svn path=/trunk/mcs/; revision=43918
2005-05-03 10:00:01 +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 1d9c9e2441 Fix warnings
svn path=/trunk/mcs/; revision=43368
2005-04-21 00:47:25 +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 e1bb860498 2005-04-10 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* HttpWebRequest.cs: now Abort() works properly. Fixes bug #74177.


svn path=/trunk/mcs/; revision=42770
2005-04-10 23:17:26 +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
Sebastien Pouliot 52e4fdc6b3 2005-04-10 Sebastien Pouliot <[email protected]>
* WebConnection.cs: Added support for TrustFailure when throwing a
	WebException. Fix bug #74286.


svn path=/trunk/mcs/; revision=42763
2005-04-10 18:26:53 +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 71ad5feecb 2005-03-30 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: we don't need to trigger the next queued request
	until the response is closed.


svn path=/trunk/mcs/; revision=42395
2005-03-30 22:10:17 +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 6a0c4b7736 2004-12-12 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs: added ReadAll method.

	* WebConnection.cs: in HandleError, set the response error after
	closing the socket. Use an async. delegate to finish reading any prior
	WebConnectionStream.

	* HttpWebRequest.cs: for error responses that allow content, read the
	stream immediately. Fixes bug #70483.


svn path=/trunk/mcs/; revision=37664
2004-12-12 20:43:09 +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 4bc82fe1ef 2004-12-05 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: set the event in Close so that if the queue is
	empty, we won't block forever on next request.


svn path=/trunk/mcs/; revision=37155
2004-12-05 23:00:58 +00:00
Gonzalo Paniagua Javier 2291c0be52 2004-12-05 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: readd prevStream. Caused regressions.


svn path=/trunk/mcs/; revision=37149
2004-12-05 21:31:58 +00:00
Gonzalo Paniagua Javier 7a23a83534 2004-12-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: handle errors on chunked streams. Fixes bug #66858.
	* ChunkStream.cs: added error checking all over.

	* HttpWebRequest.cs: throw the exception received in SetResponseError
	if we already have a response.
	(SetRequestData): Don't nest the exception if it's a WebException.


svn path=/trunk/mcs/; revision=37075
2004-12-04 11:52:31 +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 76bb2e6ce4 2004-11-19 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: check for FIN or RST on the socket before reusing.
	Fixes bug #69388.


svn path=/trunk/mcs/; revision=36298
2004-11-19 07:09:16 +00:00
Gonzalo Paniagua Javier 6e97c46f77 Forgot this
svn path=/trunk/mcs/; revision=35935
2004-11-10 00:33:06 +00:00
Gonzalo Paniagua Javier ccc7c27707 2004-11-09 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: simplified condition for WantMore property.

	* WebConnection.cs: in Connect(), finish any pending reads we might
	have for chunked data. Ignore possible blank lines at the very
	beginning of the server response. Honor user set KeepAlive in
	HttpWebRequest for HTTP/1.1 connections. Thanks to Eyal Alayuf for
	his suggestions and code.

svn path=/trunk/mcs/; revision=35934
2004-11-10 00:26:30 +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 7b5d49ae29 2004-10-04 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: ProxyQuery returns true when we use a proxy without
	tunneling a secure connection.

	* ServicePoint.cs: added UseConnect property.

	* ServicePointManager.cs: set the UseConnect property when we use a http
	proxy for a https connection.

	* WebConnection.cs: setup the tunnled connection when using a proxy and
	https.

svn path=/trunk/mcs/; revision=34682
2004-10-04 20:25:38 +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
Gonzalo Paniagua Javier 2f46599cce 2004-07-09 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: removed bogus Monitor.Exit.
	* WebConnection.cs: use Address instead of RequestUri when checking for
	the scheme in order to select the stream type. Fixes bug #61218.

svn path=/trunk/mcs/; revision=30900
2004-07-08 23:08:44 +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 671f8b5ce6 2004-06-06 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: added ChunkLeft property.
	* WebConnection.cs:
	(EndRead): when using small byte arrays to read from a chunked stream,
	ensure we've read the chunk size and try to fulfill the request
	completely. fixes bug 59653.

svn path=/trunk/mcs/; revision=28915
2004-06-06 17:41:06 +00:00
Sebastien Pouliot 3664d705e2 2004-05-03 Sebastien Pouliot <[email protected]>
* WebConnection.cs: Added missing Consts.

svn path=/trunk/mcs/; revision=26635
2004-05-03 20:06:32 +00:00
Sebastien Pouliot 0a531ec57c 2004-05-03 Sebastien Pouliot <[email protected]>
* WebConnection.cs: Use assembly name const to load Mono.Security.

svn path=/trunk/mcs/; revision=26628
2004-05-03 19:34:22 +00:00
Gonzalo Paniagua Javier ddb3f5549f Removed unused fields
svn path=/trunk/mcs/; revision=25812
2004-04-22 03:02:16 +00:00
Gonzalo Paniagua Javier b24f2374e0 2004-03-24 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: added the exception status to the error message.
	* WebConnection.cs: add headers using SetInternal instead of Add to
	bypass header name validation. Fixes bug #55994.
	* WebHeaderCollection.cs: added SetInternal (string header).

svn path=/trunk/mcs/; revision=24549
2004-03-24 22:06:56 +00:00
Gonzalo Paniagua Javier 8d801ed6b3 2004-03-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* WebConnectionGroup.cs: the requests queue is now shared for all the
	connections belonging to the same connection group.

svn path=/trunk/mcs/; revision=23695
2004-03-04 17:28:27 +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
Sebastien Pouliot 8a014ba092 2004-02-25 Sebastien Pouliot <[email protected]>
* WebConnection.cs: Update previous patch to use HttpsClientStream
	(internal in Mono.Security assembly) in place of SslClientStream.
	This will reduce reflection and allow to use ICertificatePolicy.

svn path=/trunk/mcs/; revision=23469
2004-02-25 20:50:21 +00:00
Gonzalo Paniagua Javier f91515a25e 2004-02-19 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: check for missing or wrong URI in Location header
	when redirecting.

	* WebConnection.cs: if the data read does not contain all the headers,
	keep it around and read the rest until we get to the response body.
	Allow response code with no description. Fixed bug #54543.

svn path=/trunk/mcs/; revision=23244
2004-02-19 03:05:19 +00:00
Sebastien Pouliot 4024cd5c4c 2004-02-18 Sebastien Pouliot <[email protected]>
* SecurityProtocolType.cs: Added missing [Serializable] to enum. Added
	Default and Ssl2 to NET_1_2 profile. Enum is now internal for NET_1_0
	profile (as we need it for SslClientStream).
	* ServicePoint.cs: Added internal SetCertificates(client,server).
	* ServicePointManager.cs: Added CheckCertificateRevocationList and
	CheckCertificateRevocationList static properties (public in 1.1,
	internal for 1.0).
	* WebConnection.cs: Dynamically creates a SslClientStream (from
	Mono.Security assembly) in case of https. Changed NetworkStream to
	Stream everywhere.

svn path=/trunk/mcs/; revision=23225
2004-02-18 17:58:22 +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