Commit Graph
138 Commits
Author SHA1 Message Date
Sebastien Pouliot 11037f269c Add new WP7 properties in HttpWebRequest
* HttpWebRequest_2_1.cs: Add new AllowAutoRedirect and UserAgent
properties for binary compatibility with WP7. As documented both
properties are not usable in SL4 (throws NIE) but their existance
helps writing portable code
2011-04-25 13:31:18 -04:00
Sebastien Pouliot 48fd0e1b2e Fix non-element in XML flash policy (same as #681699 was for silverlight policies)
* FlashCrossDomainPolicyParser.cs: Skip, not throw, if we find a non-
element node type in a flash policy file.
2011-04-15 15:19:12 -04:00
Rolf Bjarne Kvinge f64261401d Fix many corcompare issues for moonlight 2011-03-31 16:05:03 +02:00
Sebastien Pouliot 95482a1aba Do not allow extra elements in policy
* ClientAccessPolicyParser.cs: Fix regression (from a023b07a) found by
DRT #666. More test cases to be added into moonlight WebPolicies test
application
2011-03-25 10:15:44 -04:00
Sebastien Pouliot 0a23b07aea Relax policy parser to accept text elements - fix 681699
* ClientAccessPolicyParser.cs: Allow non-element between the expected
XML elements. Fix text, like '-', being present inside policies.
2011-03-23 13:57:23 -04:00
Sebastien Pouliot 6669a22163 Fix throwing exception in WebClient
* mcs/class/System.Net/System.Net/WebClient_2_1.cs: Do not throw
in finally clause (recent gendarme rule)
2011-03-21 09:38:49 -04:00
Sebastien Pouliot 3dbfe75434 Fix parameters names inside System.Net.dll for 2.1 profile
* System.Net/System.Net.Sockets/SocketException_2_1.cs:
* System.Net/System.Net/WebClient_2_1.cs:
* System.Net/System.Net/WebRequest_2_1.cs:
* System/System.Net.Sockets/Socket_2_1.cs:
* System/System.Net/Cookie.cs:
* System/System.Net/DnsEndPoint.cs:
* System/System.Net/EndPoint.cs:
* System/System.Net/IPAddress.cs:
* System/System.Net/IPEndPoint.cs:
* System/System.Net/SocketAddress.cs:
	Remove all red ! from corcompare in System.Net.dll (Silverlight
	4 profile) to make it easier to pinpoint other errors/warnings.
2011-02-15 08:38:06 -05:00
Miguel de Icaza 38253abf8c Add solution files 2011-02-12 22:09:49 -05:00
Larry Ewing a7e40bc796 Pinvoke symbols according to the new moonlight naming convention. 2011-02-07 10:56:50 -06:00
Sebastien Pouliot 0cf8705abf Fix access policy when more than one scheme is present #659791
* ClientAccessPolicy.cs: Remove special case for scheme
* ClientAccessPolicyParser.cs: Add scheme-only entries like full URI
2010-12-16 16:29:56 -05:00
Marek Safar 25b26705a4 Add existing class to System.Net build 2010-12-15 11:40:59 +00:00
Sebastien Pouliot e7b97d3d29 Add CookieParser to Moonlight's System.Net assembly
* moonlight_raw_System.Net.dll.sources: Add new CookieParser to the
build
2010-11-05 14:39:32 -04:00
Sebastien Pouliot 383a5e711e Use same socket family as the endpoint when retrieving the policy
* System.Net.Policy/CrossDomainPolicyManager.cs: Use same socket family
as the endpoint when retrieving the policy. Also do not try to create a
policy out of an empty stream (avoid misleading exceptions in logs)
2010-09-27 20:20:24 -04:00
Sebastien Pouliot fcdbcb49c7 Fix WebRequest.RegisterPrefix / Create to match SL in some corner cases
* System.Net/WebRequest_2_1.cs: (Create) Find the prefix that is the
closest match to the specified Uri and use it's associated creator.
(RegisterPrefix) We cannot register 'http[s]:' even if registering
'http[s]' is possible (but does not work as expected) as are the (fully)
valid 'http[s]:/[/]' values.
2010-09-23 17:10:06 -04:00
Sebastien Pouliot 016a04eb84 [moonlight] Fully honor WebResponse.SupportsHeaders
* System.Net.Policy/CrossDomainPolicyManager.cs: Use InternalHeaders,
instead of Headers, since we always use the browser stack to download
the security policies.

* System.Net/WebClient_2_1.cs: Throw a NotImplementedException from
ResponseHeaders if the response does not support them.
* System.Net/WebResponse_2_1.cs: Make Headers property smart to throw a
NotImplementedException if SupportsHeaders return false. Add a new
InternalHeaders property since the response headers are needed,
internally (e.g. policies), even if not exposed to the outside world.
2010-09-23 17:10:04 -04:00
Sebastien Pouliot dc669b3572 Ensure OnUploadProgressChanged is called on the right thread
* mcs/class/System.Net/System.Net/WebClient_2_1.cs: Use sync_context to
post the call to OnUploadProgressChanged
2010-09-02 16:18:40 -04:00
Sebastien Pouliot 56a925b467 Do not set the exception to NotSupportedException for denied headers
* mcs/class/System.Net/System.Net.Policy/ClientAccessPolicy.cs: Do not
throw a NotSupportedException here since it regress some DRT (like 656).
The (hopefully) correct fix (for DRT3001) will be committed inside moon
2010-09-02 11:13:38 -04:00
Sebastien Pouliot 5273386864 Multiple fixes for WebClient (from NCL tests)
* mcs/class/System.Net/System.Net/InternalWebRequestStreamWrapper.cs:
Ensure WebClient.WriteStreamClosedCallback is never called more than
once (even if the stream was closed by the caller). Supply the length
of the data that was written to the stream to WebClient.

* mcs/class/System.Net/System.Net/WebClient_2_1.cs: Keep an Uri of
BaseAddress handy since we'll need it later. Ensure OnWriteStreamClosed
is at least called once (inside finally). Emit UploadProgressChanged
(instead of Download*) when uploading.

* mcs/class/System.Net/System.Net/WebRequest_2_1.cs: Change text for
InvalidOperationException when the URI is not absolute (some MS tests
check for, case-sensitive, "URI").
2010-08-31 13:17:22 -04:00
Sebastien Pouliot 64c1e80dbc Multiple compatibility fixes for web headers on Moonlight
* HttpWebRequest_2_1.cs: Avoid using AllKeys (unneeded allocations)
* WebClient_2_1.cs: Copy headers to WebRequest (some special cases are
now considered) then clear them. Expose SecurityException (unwrapped)
and closely match SL4 exceptions (including inner exceptions).
* WebHeaderCollection_2_1.cs: Add missing validations on header names
and values (from original WebHeaderCollection.cs + small fix)
2010-08-25 15:58:27 -04:00
Sebastien Pouliot 6e6d592880 Fix check order and throw NSE on invalid headers 2010-07-23 14:01:39 -04:00
Sebastien Pouliot e1a5014726 2010-07-20 Sebastien Pouliot <[email protected]>
* NoAccessPolicy.cs: Set default to SecurityException each time
	IsAllowed is called since we share a single instance of this type


svn path=/trunk/mcs/; revision=160611
2010-07-20 14:39:59 +00:00
Sebastien Pouliot eeeaf44f44 2010-07-19 Sebastien Pouliot <[email protected]>
* BaseDomainPolicy.cs:
	* ICrossDomainPolicy.cs:
	* NoAccessPolicy.cs:
	* PolicyDownloadPolicy.cs:
	* SiteOfOriginPolicy.cs:
		Allow throwing something else than a SecurityException
		which is pretty rare but we got a DRT for it


svn path=/trunk/mcs/; revision=160586
2010-07-19 20:30:10 +00:00
Sebastien Pouliot a36dc89129 2010-07-14 Sebastien Pouliot <[email protected]>
* WebHeaderCollection_2_1.cs: Fix IEnumerable.GetEnumerator


svn path=/trunk/mcs/; revision=160387
2010-07-14 21:46:36 +00:00
Rolf Bjarne Kvinge 119386440c 2010-07-12 Rolf Bjarne Kvinge <[email protected]>
* NetworkChange_2_1.cs: Don't leak exceptions to native code.

svn path=/trunk/mcs/; revision=160255
2010-07-12 14:57:39 +00:00
Sebastien Pouliot aa659717f7 2010-05-14 Sebastien Pouliot <[email protected]>
* FlashCrossDomainPolicy.cs: Reverse conditions order on secure=true
	since we're currently too severe. Fix DRT668


svn path=/trunk/mcs/; revision=157359
2010-05-14 13:12:28 +00:00
Sebastien Pouliot 0e8bdc8ce3 2010-05-14 Sebastien Pouliot <[email protected]>
* WebHeaderCollection_2_1.cs: Hide the internal Dictionary and 
	provide methods to use it properly.
	* HttpWebRequest_2_1.cs: Use internal Clear method


svn path=/trunk/mcs/; revision=157358
2010-05-14 13:10:34 +00:00
Chris Toshok 987ee7eec6 2010-05-05 Chris Toshok <[email protected]>
* NetworkInterface_2_1.cs: implement for moonlight.

	* NetworkChange_2_1.cs: implement for moonlight.

svn path=/trunk/mcs/; revision=156737
2010-05-05 17:47:27 +00:00
Sebastien Pouliot 240f7e8f1d update System.Net.dll for SL4 API
svn path=/trunk/mcs/; revision=155874
2010-04-21 14:03:45 +00:00
Sebastien Pouliot 9f7ad37b2b 2010-04-13 Sebastien Pouliot <[email protected]>
* CrossDomainPolicyManager.cs: Fix previous change since it 
	breaks several valid cases (e.g. text/*, text/xml; charset=utf-8)
	and does not completely covers the application/xml case.
	Avoid possible ArgumentException while adding policies since it 
	confuse	the logs.


svn path=/trunk/mcs/; revision=155309
2010-04-13 13:16:03 +00:00
Andreia Gaita bb3ab70c3e 2010-04-13 Andreia Gaita <[email protected]>
* CrossDomainPolicyManager.cs: make the contentType detection
	look for /xml at the end, it's more reliable
	(fixes olympics for moonlight)

svn path=/trunk/mcs/; revision=155283
2010-04-13 05:06:15 +00:00
Sebastien Pouliot 7ab35a9063 2010-04-07 Sebastien Pouliot <[email protected]>
* ClientAccessPolicy.cs: Fake a "GET" method when applying a 
	policy to sockets


svn path=/trunk/mcs/; revision=154959
2010-04-07 14:11:27 +00:00
Sebastien Pouliot 82f9bc99cd 2010-04-07 Sebastien Pouliot <[email protected]>
* BaseDomainPolicy.cs: Abstract-fy IsAllowed(WebRequest) and 
	remove abstract IsAllowed(Uri,string[]) since it cannot provide
	enough information for the client access policy.
	* ClientAccessPolicy.cs: Replace IsAllowed(Uri,string[]) with
	IsAllowed(WebRequest) and add logic for AllowAnyMethod
	* ClientAccessPolicyParser.cs: Read "http-methods" attribute (new
	in SL3) and set the new AllowAnyMethod property if the value is
	"*" (the only legal value if the attribute is present).
	* FlashCrossDomainPolicy.cs: Add IsAllowed(WebRequest) since it's
	not part of BaseDomainPolicy anymore.


svn path=/trunk/mcs/; revision=154949
2010-04-07 13:15:44 +00:00
Sebastien Pouliot b61b5703ba 2010-04-06 Sebastien Pouliot <[email protected]>
* ClientAccessPolicyParser.cs: Don't forget "http-request-headers"
	as a valid attribute


svn path=/trunk/mcs/; revision=154876
2010-04-06 17:45:06 +00:00
Sebastien Pouliot 9317031d00 2010-04-06 Sebastien Pouliot <[email protected]>
* ClientAccessPolicyParser.cs: Catch extra attributes that
	leads to an invalid (no-access) policy. Fix parts of DRT#666
	* CrossDomainPolicyManager.cs: Ignore policies sent with a 
	Content-Type different than "text/*". Fix DRT#667
	* FlashCrossDomainPolicyParser.cs: Catch extra attributes and
	the case where a second policy is present (invalid xml). Fix 
	parts of DRT#666


svn path=/trunk/mcs/; revision=154862
2010-04-06 15:57:19 +00:00
Sebastien Pouliot 75701fe448 In .:
2010-04-05  Sebastien Pouliot  <[email protected]>

	* moonlight_raw_System.Net.dll.sources: Move InternalWebRequest
	StreamWrapper.cs back to System.Windows.dll

In System.Net:
2010-04-05  Sebastien Pouliot  <[email protected]>

	* InternalWebResponseStreamWrapper.cs: Move back to 
	System.Windows.dll


svn path=/trunk/mcs/; revision=154790
2010-04-05 12:55:54 +00:00
Sebastien Pouliot 14c799e227 2010-03-19 Sebastien Pouliot <[email protected]>
* SocketException_2_1.cs: Add extra ctor (soon to be used)


svn path=/trunk/mcs/; revision=153891
2010-03-19 12:42:33 +00:00
Sebastien Pouliot 55e1357774 2010-03-19 Sebastien Pouliot <[email protected]>
* HttpWebRequest_2_1.cs: AllowWriteStreamBuffering getter/setter
	throws NIE by default (must be overridden). Revert Accept and
	ContentType behavior to SL2 (identical to SL4 but different from
	SL3). 
	* WebClient_2_1.cs: Initialize UseDefaultCredentials to true. Set
	the properties when creating a new WebRequest


svn path=/trunk/mcs/; revision=153884
2010-03-19 11:52:41 +00:00
Sebastien Pouliot 6138988936 2010-03-18 Sebastien Pouliot <[email protected]>
* HttpWebRequest_2_1.cs: Add SL4 RC AllowWriteStreamBuffering and
	SupportsCookieContainer properties.
	* WebClient_2_1.cs: Add SL4 RC AllowWriteStreamBuffering and 
	UseDefaultCredentials properties.
	* WebHeaderCollection_2_1.cs: Authorization and Proxy-Authorization
	are valid (i.e. usable) headers in SL4 (in both stacks)


svn path=/trunk/mcs/; revision=153863
2010-03-18 19:31:53 +00:00
Rolf Bjarne Kvinge a621f99c7f 2010-03-16 Rolf Bjarne Kvinge <[email protected]>
* WebRequest_2_1.cs: Added UseDefaultCredentials property.

svn path=/trunk/mcs/; revision=153662
2010-03-16 12:14:30 +00:00
Jb Evain b3f3ef56c8 rename net_2_1 to moonlight
svn path=/trunk/mcs/; revision=153638
2010-03-16 08:32:37 +00:00
Sebastien Pouliot 08eb5f8d78 2010-03-12 Sebastien Pouliot <[email protected]>
* WebClient_2_1.cs: Directly set 'progress' delegate field
	* WebRequest_2_1.cs: Avoid using reflection (since it was not 
	really needed anyway)


svn path=/trunk/mcs/; revision=153521
2010-03-12 18:59:22 +00:00
Sebastien Pouliot c54a75466f In System/System.Net.Sockets:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgs.cs: Remove the use of reflection to check
	xdomain poilicy on sockets (since the policy code now resides in
	System.Net.dll)

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

	* net_2_1_raw_System.Net.dll.sources: Add types from (new internal)
	System.Net.Policy (moved from System.Windows.Browser.dll)
	* Makefile: Add reference to System.Xml.dll to parse policies

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

	* BaseDomainPolicy.cs, ClientAccessPolicy[Parser].cs, 
	CrossDomainPolicyManager.cs, FlashCrossDomainPolicy[Parser].cs,
	ICrossDomainPolicy.cs, NoAccessPolicy.cs, PolicyDownloadPolicy.cs,
	SiteOfOriginPolicy.cs: Moved from System.Net.dll with namespace 
	and minor build adjustments.


svn path=/trunk/mcs/; revision=153396
2010-03-10 13:19:46 +00:00
Andreia Gaita 8309cc7fb4 2010-03-03 Andreia Gaita <[email protected]>
* InternalWebRequestStreamWrapper.cs: don't add a newline to the
	request	data, whatever uses the data should be the one adding
	newlines if they need it	(i.e., moon's ff bridge needs it, the
	curl bridge doesn't)

svn path=/trunk/mcs/; revision=152898
2010-03-03 04:37:23 +00:00
Rolf Bjarne Kvinge 366bd6dfec 2010-02-25 Rolf Bjarne Kvinge <[email protected]>
* WebClient_2_1.cs: Emit DownloadProgressChanged events on the correct
	thread too.

svn path=/trunk/mcs/; revision=152474
2010-02-25 15:08:33 +00:00
Sebastien Pouliot f037f02074 2010-02-23 Sebastien Pouliot <[email protected]>
* HttpWebRequest_2_1.cs: Accept and ContentType properties do not
	behave like Silverlight 2.0 (not related to browser/client stacks)
	* WebHeaderCollection_2_1.cs: Range is now accepted in SL3 (not
	related to browser/client stacks)
	* WebRequest_2_1.cs: Fix registration to work on domains (new) 
	and scheme (more correctly wrt new unit tests).


svn path=/trunk/mcs/; revision=152275
2010-02-23 16:25:29 +00:00
Sebastien Pouliot 1e121ccd02 2010-02-16 Sebastien Pouliot <[email protected]>
* WebClient_2_1.cs: Keep a copy of 'userToken' since we need to
	supply it when calling OnDownloadProgressChanged
	* WebRequest_2_1.cs (SetupProgressDelegate): Simplify signature


svn path=/trunk/mcs/; revision=151800
2010-02-16 14:13:23 +00:00
Rolf Bjarne Kvinge cabcb6a011 2010-01-29 Rolf Bjarne Kvinge <[email protected]>
* WebClient_2_1.cs: Ensure the WriteStreamClosed event is emitted on
	the correct thread (by using the stored SynchronizationContext).

	* InternalWebRequestStreamWrapper.cs: Add a WebClientData field which
	is passed to the WriteStreamClosedCallback.

svn path=/trunk/mcs/; revision=150512
2010-01-28 23:22:13 +00:00
Rolf Bjarne Kvinge a7905ec465 2010-01-28 Rolf Bjarne Kvinge <[email protected]>
* WebClient_2_1.cs: The async events must be invoked on a threadpool
	thread if the async method wasn't executed on the main thread, so save
	the synchronization context when the async method is called, and post
	the event to that synchronization context when done. This is also
	required when the async methods are executed on the main thread, since
	HttpWebRequest callbacks are now always executed on a threadpool thread.

svn path=/trunk/mcs/; revision=150370
2010-01-28 12:05:07 +00:00
Sebastien Pouliot acccfd9daf In .:
2010-01-25  Sebastien Pouliot  <[email protected]>

	* System.Net.dll.sources: Add UdpAnySourceMulticastClient and
	UdpSingleSourceMulticastClient stubs (with some validations)
	for SL4 (required to compile tests)

In System.Net:
2010-01-25  Sebastien Pouliot  <[email protected]>

	* UdpAnySourceMulticastClient.cs: New. Stub for SL4
	* UdpSingleSourceMulticastClient.cs: New. Stub for SL4


svn path=/trunk/mcs/; revision=150127
2010-01-25 13:21:52 +00:00
Sebastien Pouliot 295222fc78 2010-01-13 Sebastien Pouliot <[email protected]>
* HttpWebRequest_2_1.cs: Throw for CookieContainer. It is 
	implemented only in the client http stack (and for a limited
	time in the browser stack too ;-)
	* InternalWebRequestStreamWrapper.cs: Keep the MemoryStream data
	available after closing/disposing (by user) since our own code
	will need it later (e.g. when posting like DRT287)
	* WebHeaderCollection_2_1.cs: Provide an argument to 
	ArgumentException. Found by Gendarme's ArgumentException
	InstantiateArgumentExceptionCorrectlyRule


svn path=/trunk/mcs/; revision=149484
2010-01-13 18:40:16 +00:00