Commit Graph
98 Commits
Author SHA1 Message Date
Jackson Harper 01767e670e We can accidently swallow out of FD errors here since this function is called from a threadpool thread. 2011-06-28 23:22:44 -04:00
Gonzalo Paniagua Javier 3eb2f54bb1 [HttpWebRequest] Ignore Transfer-Encoding when there's no content.
If the transfer encoding was set to chunked, we tried to read even when
	the response might known to have no content. This led to timeouts.

	Fixes bug #686371.
2011-04-09 15:18:00 -04:00
Gonzalo Paniagua Javier 891af303aa [Socket] Implemented TCP keep alive support
Implemented SetTcpKeepAlive for ServicePoint*.
2011-01-13 18:28:16 -05:00
Gonzalo Paniagua Javier 604d5faa0b More StringComparison.Ordinal
Use StringComparison.Ordinal when calling IndexOf to find the index of
	an ASCII string.
2010-10-31 17:23:18 -04:00
Gonzalo Paniagua Javier f832b99535 Avoid sending data in the challenge phase of NTLM
If there's a POST/PUT request that gets a NTLM 401, we save the data
	and don't send it again until after the challenge phase. Ie, instead of
	sending all the data 3 times, we only send it at most twice.
2010-09-01 15:52:09 -04:00
Geoff Norton 42bb87da50 Ensure that we only reflect into monotouch if the type exists.
There is a possible crash using this profile if the monotouch.dll
isn't loaded into the process space.  We will null guard the
type and only call start_wwan if its present.
2010-08-20 10:54:07 -04:00
Gonzalo Paniagua Javier eb2a5490f2 Adapt to new exception in threadpool behavior.
Since an exception in the threadpool can kill the application,
	silently ignore it when we know it is not harmful.
2010-08-11 13:15:39 -04:00
Sebastien Pouliot 9c8cb87fe3 In .:
2010-07-21  Sebastien Pouliot  <[email protected]>

	* Makefile: Ensure SECURITY_DEP gets defined in our moonlight
	raw profile

In System.Net:
2010-07-21  Sebastien Pouliot  <[email protected]>

	* ServicePointManager.cs: Add special validation for Moonlight
	* WebConnection.cs: Change a define to NET_2_1

In System.Net.Security:
2010-07-21  Sebastien Pouliot  <[email protected]>

	* LocalCertificateSelectionCallback.cs:
	* SslStream.cs:
		Don't use alias in moonlight build (not needed and breaks
		compilation otherwise)


svn path=/trunk/mcs/; revision=160675
2010-07-21 13:36:35 +00:00
Miguel de Icaza bd17ba1532 2010-03-20 Miguel de Icaza <[email protected]>
* WebConnection.cs: Drop pre-2.0 and pre-1.1 support, and remove
	warnings. 

svn path=/trunk/mcs/; revision=153946
2010-03-20 22:53:39 +00:00
Gonzalo Paniagua Javier 5c20ab97e6 2010-03-01 Gonzalo Paniagua Javier <[email protected]>
* System.Net/WebConnection.cs: attach a validation callback to the new
	event in Mono.Security.
	* System.Net/ServicePointManager.cs: added a new ValidationHelper
	class that takes care of building the certificate chain and perform
	all the check that were done in Mono.Security before. This way the 2.0
	server certificate validation callback can get all the data it needs.
	* System.Net.Security/SslStream.cs: don't do anything if a chain
	element has no error.

	Fixes bug #584050.

svn path=/trunk/mcs/; revision=152654
2010-03-01 09:01:14 +00:00
Geoff Norton 83e5b68304 remove some spew
svn path=/trunk/mcs/; revision=152138
2010-02-20 19:03:51 +00:00
Geoff Norton f3679e455e Ensure we start the WWAN for web connections in MonoTouch
svn path=/trunk/mcs/; revision=152135
2010-02-20 19:03:39 +00:00
Jb Evain 288e614ea4 bring Mono Security to monotouch
svn path=/trunk/mcs/; revision=141615
2009-09-09 15:34:58 +00:00
Gonzalo Paniagua Javier 3d39a08751 2009-09-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: if the request has already finished reading, don't
	throw ObjectDisposedException here, just return as if nothing
	happened. Fixes bug #312968.


svn path=/trunk/mcs/; revision=141346
2009-09-04 17:35:08 +00:00
Gonzalo Paniagua Javier 94659b81ae 2009-08-29 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: HEAD response does not have a body even if the
	response is an error. Fixes buf #535102.


svn path=/trunk/mcs/; revision=140923
2009-08-29 21:09:20 +00:00
Gonzalo Paniagua Javier 781e4faf6c 2009-07-02 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: provide better error message when there's an error
	writing.
	* WebConnectionStream.cs: don't nullify the buffer until
	CheckFinalStatus() decides that there are no more authentication
	retries or redirects.


svn path=/trunk/mcs/; revision=137332
2009-07-02 23:03:11 +00:00
Gonzalo Paniagua Javier 1c8629a808 2009-07-02 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: must use the 'int' version in 1.1.


svn path=/trunk/mcs/; revision=137231
2009-07-02 07:22:59 +00:00
Gonzalo Paniagua Javier d0aef15578 2009-07-01 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* ServicePoint.cs: UseNagleAlgorithm determines NoDelay value.


svn path=/trunk/mcs/; revision=137202
2009-07-01 16:49:32 +00:00
Gonzalo Paniagua Javier 7584df6cf8 2009-06-25 Gonzalo Paniagua Javier <[email protected]>
* WebAsyncResult.cs: new field that tells us if the request is being
	written automatically because we reached the content length.
	* WebConnection.cs:
	* WebConnectionStream.cs: make sure we only access the NetworkStream
	while we own it. Automatically write the request when we reach
	ContentLength number of bytes. Kill the write buffer as soon as
	possible. Don't use the buffer at all when chunked encoding is
	enabled.

	Fixes bugs #515931 and #510642.

svn path=/trunk/mcs/; revision=136900
2009-06-25 23:23:24 +00:00
Gonzalo Paniagua Javier 777d9fb576 2009-06-24 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: 'socket' and 'Data' where being changed by 2
	threads at the same time when there were queued requests and the
	current one was aborted in Connect().
	* HttpWebRequest.cs: 'aborted' is now an int and we use Interlocked to
	access it. Added WebConnection field used when aborting the request.

	Fixes bug #514591 for good.


svn path=/trunk/mcs/; revision=136753
2009-06-24 06:41:14 +00:00
Gonzalo Paniagua Javier 548ab41616 2009-06-19 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: make sure we don't open a new socket if the
	request is aborted before we establish the connection. Fixes bug
	#514591.

	* HttpWebRequest.cs: new property to return abort status. Invoke the
	abort handler before doing anything else when Abort() is called for
	the first time.


svn path=/trunk/mcs/; revision=136516
2009-06-19 20:20:35 +00:00
Andrés G. Aragoneses aa75a48a07 2009-06-16 Andrés G. Aragoneses <[email protected]>
* WebConnection.cs: propagate the exception to the request.    
        * WebException.cs: new internal ctor.
        * HttpWebRequest.cs: use new ctor to encapsulate the innerException.
        Fixes #323452.

2009-06-16  Andrés G. Aragoneses  <[email protected]>

        * WebRequestTest.cs: Drop NotWorking attrib, more accurate tests.


svn path=/trunk/mcs/; revision=136198
2009-06-16 04:21:58 +00:00
Gonzalo Paniagua Javier 9cef28ffa2 2009-04-21 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* HttpWebRequest.cs: provide more information on why the connection
	could not be established.


svn path=/trunk/mcs/; revision=132220
2009-04-21 04:24:42 +00:00
Gonzalo Paniagua Javier 42bcc2f506 2009-02-03 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* HttpWebRequest.cs: calling Abort is safe now if the request has been
	read entirely.


svn path=/trunk/mcs/; revision=125633
2009-02-04 01:50:09 +00:00
Gonzalo Paniagua Javier 07c165832b 2008-10-23 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: don't call ProxyRequest twice.
	* WebConnectionData.cs: remove unused fields.

	* WebConnection.cs:
	* WebConnectionStream.cs: when setting the input buffer, check to see
	if the entire response is already there and free up the request slot.
	Fixes bug #423156.

	* ResponseStream.cs:
	* HttpListenerResponse.cs: buffer the headers so that they are sent
	together with the data on the first Write (if any). The fix above
	didn't work with our HttpListener without this.


svn path=/trunk/mcs/; revision=116868
2008-10-23 19:11:33 +00:00
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
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
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