(TryParse): Changed argument name to match MS.
(ParseIPV4): Only treat zero-length or " " address as empty on 1.0
profile. On 2.0 profile, only ignore characters after blank if last
part is valid hex string.
* IPv6Address.cs: Removed extra spaces and tabs.
* IPAddressTest.cs: Remove use of deprecated Assertion. Improved
existing tests.
svn path=/trunk/mcs/; revision=94052
* HttpWebRequest.cs: fixed typo. Use the actual uri for correct
cookie header informations and not the originally one.
svn path=/trunk/mcs/; revision=94023
* Cookie.cs: set Version to '1' if Port is set,
don't include path and domain informations when version is 0,
match ToString () output with .NET 2.0,
fixes bug #316017
* CookieTest.cs: enabled ToString () test,
added Version property test
svn path=/trunk/mcs/; revision=94013
* WebClient.cs: We catch exceptions that happen on the helper
async threads toa void terminating the application on errors, and
also raise a variant of the OnXXXXCompleted methods that take an
Exception argument.
Note that this differs from the .NET implementation in that
we actually raise a signal on error, and set the exception, and in
their case no error is ever raised.
We now call CompleteAsync in the OnXXXCompleted handlers to ensure
that the WebClient can be reused immediately by the callback.
This fixes#350621.
This also should fix the bug report on IRC where someone
complained that they could not "chain" invocations to XXXAsync
methods from the OnXXXXCompleted handlers due to the WebClient
refusing to work if there was an ongoing operation
svn path=/trunk/mcs/; revision=91959
* WebClient.cs: Do not validate method to be null, we do not do
that in OpenWrite, the detection is done later on.
Fixes#350622
svn path=/trunk/mcs/; revision=91867
* WebClient.cs (DownloadFileCore): use longs for the
ContentLength, although the other code (loading into a byte array,
or a string) still uses ints, the DownloadFileCore should not.
2007-12-11 Miguel de Icaza <[email protected]>
* WebClient.cs:
Lots of fixes to get the *Async methods to work.
* WebClient.cs: async, new boolean flag, used to track whether we
are an async invocation, and if so, we need to invoke some
methods.
Switch to using System.Threading.Thread instead of the ThreadPool
as there is no way with the ThreadPool to abort threads (to
implemente CancelAsync).
(CompleteAsync): Helper method used to clear the state after an
async operation completes, otherwise the WebClient can only be
used once.
(CancelAsync): Use Thread.Interrupt to signal the thread that we
are aborting it (it is a lot milder than Thread.Abort, and we are
in no rush to cancel this anyways); Also the documentation states
that we need to call the WebRequest.Abort method, so we do that in
every Download instance.
(DownloadDataAsync, DownloadFileAsync, DownloadStringAsync,
OpenReadAsync, OpenWriteAsync, UplaodDataAsync, UploadFileAsync,
UploadStringAsync): Make signature parameters match MS; use
threads instead of threadpool (so we can implement CancelAsync),
catch ThreadAbortException here so we can also raise the proper
DownloadDataCompleteEventArgs.
These routines will also call the WebRequest.Abort when
appropriate when ThreadInterrupted is used.
(ReadAll): Raise DownloadProgressChanged events.
svn path=/trunk/mcs/; revision=91142
* 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
* ListenerAsyncResult.cs: Only send the 401 header if our authentication
type is Basic or Negotiate (which we default to basic) because that is
all we support. Set the WWW-Authenticate header when we return a 401
result. Send the correct state object in the async result.
svn path=/trunk/mcs/; revision=89174
* ListenerAsyncResult.cs: If the HttpListener has an authentication
scheme, the user should be presented with a 401 without calling the
callback.
svn path=/trunk/mcs/; revision=88981
* FtpWebRequest.cs (GetResponseStatus): Fix this routine
propertly, refactor, and make it follow Mono coding conventions.
svn path=/trunk/mcs/; revision=88820
* HttpListener.cs: Remove more trigger-happy disposed=true from
the code; We should only dispose when the Dispose method is
actually called. Not before.
Fixes#337371
svn path=/trunk/mcs/; revision=88323
* HttpListener.cs (Close): Closing does not mean dispose the
object. This allows Start/Stop/Start to be called as many times
as desired.
Fixes#337368
svn path=/trunk/mcs/; revision=88322
1.0 profile change. Added trivial tests to argument null checks.
Added test for DefaultWebProxy. Fixed line endings.
* WebRequest.cs: Changed serialization ctor to throw NIE on 1.0
profile. Cache default proxy, but still allow it to be explicitly set
to null.
svn path=/trunk/mcs/; revision=87517
* HttpListener2Test.cs: Removed CWL.
* HttpListenerRequest.cs: Removed dead code. USe String.Length to
check for zero-length string. Use instance field for is_chunked, and
also set it for GET/HEAD/DELETE. Fixed HasEntityBody to return true
when Content-Length > 0, or Transfer-Encoding is chunked.
* System_test.dll.sources: Added HttpListenerRequestTest.cs.
svn path=/trunk/mcs/; revision=86666
* HttpListenerRequest.cs: HasEntityBody should return false when method is GET/HEAD,
content_length is less than or equal to zero or the request is
chunked. Fixes bug #325296
svn path=/trunk/mcs/; revision=86555
* HttpListenerRequest.cs: make sure 'method' is always stored in
upper case.
The DELETE method must not error out on missing Content-Length
header (this is the behavior of the MS.NET version of the
class). Fixes bug #323215.
svn path=/trunk/mcs/; revision=86552
* HttpWebRequest_2_1.cs, HttpWebResponse_2_1.cs :
added new sources for those classes for 2.1 (in 2.1 they are
almost abstract, while in 2.0 they are concrete).
* HttpRequestCreator.cs, ServicePoint.cs :
#ifdef 2.0 dependencies out.
* net_2_1_System.dll.sources :
Replaced HttpWebRequest and HttpWebResponse with those for 2.1,
and removed related 2.0-only types.
svn path=/trunk/mcs/; revision=83773