Commit Graph
189 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 6450a342e5 [HttpWebRequest] EndGetResponse already does this. 2011-02-14 14:36:14 -05:00
Gonzalo Paniagua Javier 2fa2ca3565 [HttpWebRequest] Use the timeout in GetResponse()
The timeout was not being used in GetResponse.
	Fixes bug #603794.
2011-02-13 15:01:29 -05:00
Gonzalo Paniagua Javier b92b165ddb [HttpWebRequest] Error handling for POST/PUT
When we get an error from the server before writing an entire
	unbuffered response, the server might close the connection leading to
	write errors. Ignore those and return the actual HTTP status code from
	the original server error.
2011-02-10 17:25:15 -05:00
Gonzalo Paniagua Javier f4c13c06c7 Allow forcing HTTP protocol version
If the version is manually set, ignore the version from the service
	point when set.

	Fixes bug #668199.
2011-01-31 10:48:37 -05:00
Gonzalo Paniagua Javier c6b1dd9db3 [HttpWebRequest] New 4.0 AddRange overloads. 2011-01-18 18:56:32 -05:00
Gonzalo Paniagua Javier fb13ef43ce [HttpWebRequest] Support 4.0 Date property. 2011-01-18 16:44:12 -05:00
Gonzalo Paniagua Javier 9ae3d21c17 [HttpWebRequest] Support 4.0 Host property. 2011-01-18 12:52:58 -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 ce6effffda Set have_response
Set have_response to true when there's a protocol error or a previous
	exception for POST/PUT.
	Patch by Bassam Tabbara.
2010-10-04 02:44:40 -04:00
Gonzalo Paniagua Javier 8823d1c040 Remove Content-Length header when not needed
If we are redirecting to a GET from a POST, the Content-Length header
	might have stale data and it will be sent. Some servers, instead of
	ignoring it, keep waiting for the data to be sent (for a GET!).

	Fixes bug #636219.
2010-09-01 17:57:55 -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
Gonzalo Paniagua Javier d40bb3a606 2010-06-16 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: DELETE allows an entity body.
	Fixes bug #614483.


svn path=/trunk/mcs/; revision=159036
2010-06-16 20:24:45 +00:00
Gonzalo Paniagua Javier f4ce05c1ce 2010-06-15 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: 307 does not change request method.


svn path=/trunk/mcs/; revision=158980
2010-06-15 21:58:30 +00:00
Gonzalo Paniagua Javier f0f2e24381 2010-04-15 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: set content length to -1 on redirect. Reset
	'FinishedReading' on redirects. Fixes bug #593596.


svn path=/trunk/mcs/; revision=155604
2010-04-16 02:16:12 +00:00
Gonzalo Paniagua Javier 6ad1d32e9e 2010-03-27 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: when PreAuthenticate is true, don't remove the
	existing authorization related headers until we know we have a
	replacement. Fixes bug #591633.


svn path=/trunk/mcs/; revision=154348
2010-03-27 16:27:20 +00:00
Sebastien Pouliot 355a27b73d In System.Timers:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* Timer.cs: Removed old NET_2_0 defines and added some new
	MOONLIGHT defines (needed for the client stack)

In System.Net:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* AuthenticationManager.cs: Internal type for Moonlight.
	Add BasicClient, DigestClient, NtlmClient for NET_2_1 since
	this applies to both monotouch and moonlight (client stack).
	Removed unneeded NET_2_0 defines
	* CookieContainer.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll. Removed unneeded NET_2_0
	defines
	* HttpContinueDelegate.cs: Internal type for Moonlight.
	* HttpRequestCreator.cs: Remove a MOONLIGHT define
	* HttpStatusCode.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll
	* HttpWebRequest.cs: Internal type for Moonlight. Change S.Config
	to NET_2_1 defines (applies to both monotouch and moonlight).
	Removed unneeded NET_2_0 and NET_1_1 defines
	* HttpWebResponse.cs: Internal type for Moonlight. Removed 
	unneeded NET_2_0 defines
	* IAuthenticationModule.cs: Internal type for Moonlight.
	* ICertificatePolicy.cs: Internal type for Moonlight.
	* ICredentialPolicy.cs: Internal type for Moonlight. Removed 
	unneeded NET_2_0 defines
	* IWebRequestCreate.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll
	* ServicePoint.cs: Internal type for Moonlight. Change S.Config
	to NET_2_1 defines (applies to both monotouch and moonlight)
	* ServicePointManager.cs: Remove a MOONLIGHT define
	* WebException.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll. Removed unneeded NET_2_0
	defines
	* WebHeaderCollection.cs: Internal type for Moonlight. Removed 
	unneeded NET_2_0 defines
	* WebRequest.cs: Internal type for Moonlight. Change S.Config
	to NET_2_1 defines (applies to both monotouch and moonlight)
	* WebResponse.cs: Internal type for Moonlight. Removed unneeded
	NET_2_0 defines

In System.Net.Sockets:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* Socket.cs: Remove some NET_2_0 defines (using) and add a few
	MOONLIGHT defines needed to reuse Socket in the client http stack
	* Socket_2_1.cs: Remove some MOONLIGHT defines
	* SocketAsyncEventArgs.cs: For Moonlight check policy if outside
	System.dll (the client stack use sockets with it's own web 
	xdomain policy)

In System:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* Uri.cs: Remove some MOONLIGHT defines

In .:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* moonlight_*_System.dll.sources: Bring extra types so we can
	build a full, managed, internal HTTP stack to be reused for SL3+
	* Makefile: Add a INSIDE_SYSTEM define when compiling System.dll
	to makes it possible to rebuild the same types in System.Net.dll


svn path=/trunk/mcs/; revision=153916
2010-03-19 19:01:31 +00:00
Gonzalo Paniagua Javier 544931f4aa 2010-01-13 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: when the server returns several different
	authentication methods, pick the one that works.
	Fixes bug #562043.


svn path=/trunk/mcs/; revision=149500
2010-01-13 23:22:38 +00:00
Gonzalo Paniagua Javier ae20ad47f0 2009-08-13 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs:
	* WebConnectionStream.cs: if there's an error writing the headers from
	a buffered request, propagate the error instead of hiding it and
	causing a different one later (ie, ObjectDisposedException instead of
	the original WebException). This happened when posting without
	Content-Length set to an HTTPS url without validating the server
	certificate.


svn path=/trunk/mcs/; revision=139885
2009-08-13 22:12:18 +00:00
Jb Evain f2a6f61bad use a 2.0 network stack for MONOTOUCH
svn path=/trunk/mcs/; revision=139255
2009-08-02 15:43:12 +00:00
Gonzalo Paniagua Javier 547e70a03b 2009-07-07 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: set the content length when uploading values. This
	allows reusing the connection.
	* WebConnectionStream.cs: SetHeaders() takes ownership of the buffer
	and does not need to copy it any more. WriteRequest() wasn't always
	setting 'requestWritten' to true.
	* HttpWebRequest.cs: change in SetHeaders call.


svn path=/trunk/mcs/; revision=137497
2009-07-07 14:57:51 +00:00
Gonzalo Paniagua Javier 7ff2c1978d 2009-07-02 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: avoid duplicating Accept-Encoding if GetHeaders()
	is called twice.
	* WebConnectionStream.cs: don't send a 0 content length for non-write
	requests.


svn path=/trunk/mcs/; revision=137233
2009-07-02 07:33:12 +00:00
Gonzalo Paniagua Javier 1691d6ff66 2009-06-28 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: fix 1.1 only test.


svn path=/trunk/mcs/; revision=137046
2009-06-28 07:17:33 +00:00
Gonzalo Paniagua Javier d89546ba92 2009-06-26 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: don't send Content-Length header when SendChunked
	is enabled.
	* WebConnectionStream.cs: send the headers immediately when possible.
	When writing the request before a Close(), if there was an exception
	it was lost.


svn path=/trunk/mcs/; revision=137019
2009-06-26 22:45:35 +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 ef5b9248c9 2009-06-21 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: check for an aborted request in Begin* before
	proceeding. Fixes bug #511851.


svn path=/trunk/mcs/; revision=136574
2009-06-22 02:00: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 9e79c42076 2009-06-15 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: for unknown methods, always send the request once
	we are connected even if there's no writeStream. Fixes bug #513087.


svn path=/trunk/mcs/; revision=136136
2009-06-15 15:37:55 +00:00
Gonzalo Paniagua Javier 90e8e19238 2009-06-09 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: ProtocolViolationException is not thrown in
	certain cases since 2.0. Fixes bug #508027.


svn path=/trunk/mcs/; revision=135767
2009-06-09 15:40:35 +00:00
Gonzalo Paniagua Javier 0721301465 2009-06-09 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: follow MS docs when throwing
	ProtocolViolationException at the beginning of an asynchronous
	operation. Fixes bug #465613.


svn path=/trunk/mcs/; revision=135758
2009-06-09 15:14:13 +00:00
Gonzalo Paniagua Javier b803228aad 2009-06-02 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: KeepAlive check not needed.
	Fixes bug #465613.


svn path=/trunk/mcs/; revision=135246
2009-06-02 22:13:45 +00:00
Gonzalo Paniagua Javier d3637642f7 2009-05-16 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs:
	* HttpWebRequest.cs: support automatic decompression of the response.
	Fixes bug #504391.



svn path=/trunk/mcs/; revision=134269
2009-05-16 05:47:01 +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 4771a3f360 2009-02-08 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: lock SetResponseError.


svn path=/trunk/mcs/; revision=126292
2009-02-08 23:11:03 +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 0a087b4e24 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: added locking in SetResponseData for the case
	when we get an error response before BeginGetResponse has been
	called.


svn path=/trunk/mcs/; revision=124452
2009-01-26 05:02:47 +00:00
Marek Habersack 5e95e86db1 2009-01-19 Marek Habersack <[email protected]>
* HttpWebRequest.cs: implemented the UseDefaultCredentials
	property, patch from Florian Maetschke <[email protected]>,
	thanks!

svn path=/trunk/mcs/; revision=123792
2009-01-19 13:22:39 +00:00
Gonzalo Paniagua Javier c95dfe4d99 2009-01-14 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: create a result from the response when
	*GetResponse() has not been called yet and we have already received
	all the data.
	Fixes bug #464013.


svn path=/trunk/mcs/; revision=123313
2009-01-14 05:47:13 +00:00
Gonzalo Paniagua Javier 4f7efa726b 2009-01-13 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: keepAlive is of no use here.
	Fixes bug #465613.


svn path=/trunk/mcs/; revision=123252
2009-01-13 20:51:11 +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
Gonzalo Paniagua Javier c058b49aef 2008-10-08 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: if GetRequestStream has already been called,
	return the same stream that we returned in the first call.
	Fixes bug #429200.


svn path=/trunk/mcs/; revision=115225
2008-10-08 15:25:53 +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
Marek Habersack a422125966 2008-04-16 Marek Habersack <[email protected]>
* HttpWebRequest.cs: fix an off-by-one bug - the number of
	redirects must not exceed the value of
	MaximumAutomaticRedirections. Fixes bug #380131

svn path=/trunk/mcs/; revision=100780
2008-04-15 23:35:35 +00:00
Daniel Nauck 71883e528e 2008-01-26 Daniel Nauck <[email protected]>
* HttpWebRequest.cs: fixed typo. Use the actual uri for correct
	cookie header informations and not the originally one.


svn path=/trunk/mcs/; revision=94023
2008-01-26 21:14:20 +00:00
Marek Habersack fb23c6fb46 2007-11-16 Marek Habersack <[email protected]>
* HttpWebRequest.cs: when folding a request into a GET one, set
	content length to 0 and kill the buffers. Fixes bug #327314. Patch
	from Geoff Norton <[email protected]>, thanks!

svn path=/trunk/mcs/; revision=89790
2007-11-16 20:31:22 +00:00
Marek Safar e61dde083e Warnings cleanup
svn path=/trunk/mcs/; revision=89678
2007-11-15 14:14:49 +00:00
Jb Evain 7d74c61c3a 2007-08-08 Jb Evain <[email protected]>
* HttpWebRequest.cs: .ctor(Uri) is public in 2.1.

svn path=/trunk/mcs/; revision=83635
2007-08-08 06:48:13 +00:00
Dick Porter 6b41703ee1 2007-06-21 Dick Porter <[email protected]>
* AuthenticationManager.cs: 
	* FtpWebRequest.cs: 
	* Cookie.cs: 
	* ServicePoint.cs: 
	* WebClient.cs: 
	* Authorization.cs: 
	* FileWebRequest.cs: 
	* HttpWebRequest.cs: 
	* WebResponse.cs: 
	* ServicePointManager.cs: 
	* HttpWebResponse.cs: Throw NotImplementedException indirectly, to
	reduce noise in Moma reports.



svn path=/trunk/mcs/; revision=80484
2007-06-21 15:24:34 +00:00
Dick Porter fa277dafe1 2007-06-19 Dick Porter <[email protected]>
* AuthenticationManager.cs: 
	* IWebProxyScript.cs: 
	* Authorization.cs: 
	* Cookie.cs: 
	* CookieException.cs: 
	* CredentialCache.cs: 
	* FileWebRequest.cs: 
	* WebRequest.cs: 
	* FileWebResponse.cs: 
	* WebResponse.cs: 
	* FtpWebRequest.cs: 
	* HttpWebRequest.cs: 
	* DecompressionMethods.cs: 
	* HttpWebResponse.cs: 
	* ProtocolViolationException.cs: 
	* ServicePoint.cs: 
	* ServicePointManager.cs: 
	* WebClient.cs: 
	* WebException.cs: 
	* WebHeaderCollection.cs: 
	* WebProxy.cs: 
	* WebExceptionStatus.cs: 2.0 profile updates



svn path=/trunk/mcs/; revision=80152
2007-06-19 13:23:16 +00:00