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.
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.
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.
* HttpWebRequest.cs: set content length to -1 on redirect. Reset
'FinishedReading' on redirects. Fixes bug #593596.
svn path=/trunk/mcs/; revision=155604
* 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-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
* HttpWebRequest.cs: when the server returns several different
authentication methods, pick the one that works.
Fixes bug #562043.
svn path=/trunk/mcs/; revision=149500
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* HttpWebRequest.cs: follow MS docs when throwing
ProtocolViolationException at the beginning of an asynchronous
operation. Fixes bug #465613.
svn path=/trunk/mcs/; revision=135758
* WebConnection.cs:
* HttpWebRequest.cs: provide more information on why the connection
could not be established.
svn path=/trunk/mcs/; revision=132220
* 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
* 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
* 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
* 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
* 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
* HttpWebRequest.cs: fixed typo. Use the actual uri for correct
cookie header informations and not the originally one.
svn path=/trunk/mcs/; revision=94023
* 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