Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
//
// System.Net.Configuration.AuthenticationModuleElement.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class AuthenticationModuleElement : ConfigurationElement
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty typeProp;
#endregion // Fields
#region Constructors
static AuthenticationModuleElement ()
{
typeProp = new ConfigurationProperty ("type", typeof (string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
properties = new ConfigurationPropertyCollection ();
properties.Add (typeProp);
}
public AuthenticationModuleElement ()
{
}
public AuthenticationModuleElement (string typeName)
{
Type = typeName;
}
#endregion // Constructors
#region Properties
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
[ConfigurationProperty ("type", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
public string Type {
get { return (string) base [typeProp]; }
set { base [typeProp] = value; }
}
#endregion // Properties
}
}
#endif

View File

@@ -0,0 +1,117 @@
//
// System.Net.Configuration.AuthenticationModuleElementCollection.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
[ConfigurationCollection (typeof (AuthenticationModuleElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
public sealed class AuthenticationModuleElementCollection : ConfigurationElementCollection
{
#region Constructors
[MonoTODO]
public AuthenticationModuleElementCollection ()
{
}
#endregion // Constructors
#region Properties
[MonoTODO]
public AuthenticationModuleElement this [int index] {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public new AuthenticationModuleElement this [string name] {
get { return (AuthenticationModuleElement) base [name]; }
set { base [name] = value; }
}
#endregion // Properties
#region Methods
public void Add (AuthenticationModuleElement element)
{
BaseAdd (element);
}
public void Clear ()
{
BaseClear ();
}
protected override ConfigurationElement CreateNewElement ()
{
return new AuthenticationModuleElement ();
}
[MonoTODO ("argument exception?")]
protected override object GetElementKey (ConfigurationElement element)
{
if (!(element is AuthenticationModuleElement))
throw new ArgumentException ("element");
return ((AuthenticationModuleElement)element).Type;
}
public int IndexOf (AuthenticationModuleElement element)
{
return BaseIndexOf (element);
}
public void Remove (AuthenticationModuleElement element)
{
BaseRemove (element);
}
public void Remove (string name)
{
BaseRemove (name);
}
public void RemoveAt (int index)
{
BaseRemoveAt (index);
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,94 @@
//
// System.Net.Configuration.AuthenticationModulesSection.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class AuthenticationModulesSection : ConfigurationSection
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty authenticationModulesProp;
#endregion // Fields
#region Constructors
static AuthenticationModulesSection ()
{
authenticationModulesProp = new ConfigurationProperty ("", typeof (AuthenticationModuleElementCollection),
null, ConfigurationPropertyOptions.IsDefaultCollection);
properties = new ConfigurationPropertyCollection ();
properties.Add (authenticationModulesProp);
}
public AuthenticationModulesSection ()
{
}
#endregion // Constructors
#region Properties
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
[ConfigurationProperty ("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public AuthenticationModuleElementCollection AuthenticationModules {
get { return (AuthenticationModuleElementCollection) base [authenticationModulesProp]; }
}
#endregion // Properties
#region Methods
[MonoTODO]
protected override void PostDeserialize ()
{
}
[MonoTODO]
protected override void InitializeDefault ()
{
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,86 @@
//
// System.Net.Configuration.BypassElement.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class BypassElement : ConfigurationElement
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty addressProp;
#endregion // Fields
#region Constructors
static BypassElement ()
{
addressProp = new ConfigurationProperty ("address", typeof (string),
null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
properties = new ConfigurationPropertyCollection ();
properties.Add (addressProp);
}
public BypassElement ()
{
}
public BypassElement (string address)
{
Address = address;
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("address", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
public string Address {
get { return (string) base [addressProp]; }
set { base [addressProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
}
}
#endif

View File

@@ -0,0 +1,117 @@
//
// System.Net.Configuration.BypassElementCollection.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2004
// (c) 2004 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
[ConfigurationCollection (typeof (BypassElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
public sealed class BypassElementCollection : ConfigurationElementCollection
{
#region Constructors
public BypassElementCollection ()
{
}
#endregion // Constructors
#region Properties
[MonoTODO]
public BypassElement this [int index] {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public new BypassElement this [string name] {
get { return (BypassElement) base [name]; }
set { base [name] = value; }
}
protected override bool ThrowOnDuplicate {
get { return false; }
}
#endregion // Properties
#region Methods
public void Add (BypassElement element)
{
BaseAdd (element);
}
public void Clear ()
{
BaseClear ();
}
protected override ConfigurationElement CreateNewElement ()
{
return new BypassElement ();
}
[MonoTODO ("argument exception?")]
protected override object GetElementKey (ConfigurationElement element)
{
if (!(element is BypassElement))
throw new ArgumentException ("element");
return ((BypassElement)element).Address;
}
public int IndexOf (BypassElement element)
{
return BaseIndexOf (element);
}
public void Remove (BypassElement element)
{
BaseRemove (element);
}
public void Remove (string name)
{
BaseRemove (name);
}
public void RemoveAt (int index)
{
BaseRemoveAt (index);
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,229 @@
2009-12-11 Miguel de Icaza <miguel@novell.com>
* SmtpNetworkElement.cs: Add new "targetName" property for smtp.
2009-11-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
* ConnectionManagementElement.cs: bump maxconnection to 6.
2009-09-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
* DefaultProxyHandler.cs: handle upper and lowercase HTTP_PROXY and
the Any address. Fixes bug #537283.
2009-06-05 Marek Safar <marek.safar@gmail.com>
* NetConfigurationHandler.cs, DefaultProxyHandler.cs,
NetAuthenticationModuleHandler.cs, ConnectionManagementHandler.cs,
WebRequestModuleHandler.cs: Always build
IConfigurationSectionHandler.
2007-11-13 Atsushi Enomoto <atsushi@ximian.com>
* SmtpNetworkElement.cs, SmtpSection.cs : added missing 2,0 stuff.
2007-11-07 Atsushi Enomoto <atsushi@ximian.com>
* SmtpNetworkElement.cs : default UserName is null.
Fixed bug #323272.
2007-02-18 Geoff Norton <gnorton@customerdna.com>
* AuthenticationModulesSection.cs: Remove NotImpl from
InitializeDefault ().
2006-12-10 David Elkind <davide@mainsoft.com>
* SmtpSection.cs : Removed unnecessary initialization
* SmtpNetworkElement.cs : Removed unnecessary initialization
2006-05-09 Atsushi Enomoto <atsushi@ximian.com>
* DefaultProxySection.cs :
remove NotImpl from PostDeserialize() and Reset().
(ditto).
2006-05-09 Atsushi Enomoto <atsushi@ximian.com>
* WebRequestModulesSection.cs :
don't throw NotImpl in InitializeDefault().
* WebRequestModuleElement.cs :
TypeTypeConverter -> TypeConverter and uncomment it.
* WebRequestModuleElementCollection.cs :
element is WebRequestModuleElement in GetElementKey().
Similarly no actual config change yet.
2006-05-09 Atsushi Enomoto <atsushi@ximian.com>
* ConnectionManagementHandler.cs : (ConnectionManagementData) add
Add(string,int) overload so that it could be used with
ConnectionManagementSection seamlessly.
* ConnectionManagementElementCollection.cs :
create ConnectionManagementElement. in CreateNewElement().
remove extra MonoTODO as it does not (well, won't) happen anymore.
The actual configuration file change will follow in the later stage
since it needs changes in ConfigurationSettings and sys.conf.dll.
2005-12-14 Chris Toshok <toshok@ximian.com>
* MailSettingsSectionGroup.cs, PerformanceCountersElement.cs,
SmtpNetworkElement.cs, SmtpSection.cs,
SmtpSpecifiedPickupDirectoryElement.cs, WebProxyScriptElement.cs:
add missing 2.0 configuration classes.
* AuthenticationModulesSection.cs, BypassElementCollection.cs,
HttpCachePolicyElement.cs, NetSectionGroup.cs,
ServicePointManagerElement.cs, SettingsSection.cs,
SocketElement.cs, WebRequestModuleElementCollection.cs,
WebRequestModuleElement.cs, WebRequestModulesSection.cs: more 2.0
config cleanup work.
* MailSettingsSection.cs, SmtpElement.cs,
UriParserElementCollection.cs, UriParserElement.cs,
UriParserSection.cs: remove these 2.0 classes as they aren't there
anymore.
2005-12-13 Chris Toshok <toshok@ximian.com>
* AuthenticationModuleElementCollection.cs,
AuthenticationModuleElement.cs, AuthenticationModulesSection.cs,
BypassElementCollection.cs, BypassElement.cs,
ConnectionManagementElementCollection.cs,
ConnectionManagementElement.cs, ConnectionManagementSection.cs,
DefaultProxySection.cs, FtpCachePolicyElement.cs,
HttpCachePolicyElement.cs, HttpWebRequestElement.cs,
Ipv6Element.cs, ModuleElement.cs, NetSectionGroup.cs,
ProxyElement.cs, RequestCachingSection.cs: 2.0 config cleanup work.
2005-11-09 Michael Hutchinson <m.j.hutchinson@gmail.com>
* DefaultProxyHandler.cs: Read proxy address from environment, fall
back on unvalid URIs
2005-10-18 Gert Driesen <drieseng@users.sourceforge.net>
* HttpWebRequestElement.cs: Added missing properties and
attributes.
2005-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* NetConfigurationHandler.cs: new attribute 'useUnsafeHeaderParsing'.
It's value is ignored. Fixes bug #76442.
2005-08-02 Raja R Harinath <rharinath@novell.com>
* HttpCachePolicyElement.cs: Fix compilation with mcs 1.0.
CONFIGURATION_DEP implies XML_DEP.
2005-07-05 Raja R Harinath <rharinath@novell.com>
* HttpCachePolicyElement.cs: Add CONFIGURATION_DEP guard.
* AuthenticationModuleElementCollection.cs: Replace XML_DEP guard
with CONFIGURATION_DEP.
* AuthenticationModuleElement.cs: Likewise.
* AuthenticationModulesSection.cs: Likewise.
* BypassElementCollection.cs: Likewise.
* BypassElement.cs: Likewise.
* ConnectionManagementElementCollection.cs: Likewise.
* ConnectionManagementElement.cs: Likewise.
* ConnectionManagementSection.cs: Likewise.
* DefaultProxySection.cs: Likewise.
* HttpWebRequestElement.cs: Likewise.
* Ipv6Element.cs: Likewise.
* MailSettingsSection.cs: Likewise.
* ModuleElement.cs: Likewise.
* NetSectionGroup.cs: Likewise.
* ProxyElement.cs: Likewise.
* RequestCachingSection.cs: Likewise.
* ServicePointManagerElement.cs: Likewise.
* SettingsSection.cs: Likewise.
* SmtpElement.cs: Likewise.
* SocketElement.cs: Likewise.
* UriParserElementCollection.cs: Likewise.
* UriParserElement.cs: Likewise.
* UriParserSection.cs: Likewise.
* WebRequestModuleElementCollection.cs: Likewise.
* WebRequestModuleElement.cs: Likewise.
* WebRequestModulesSection.cs: Likewise.
2005-06-15 Lluis Sanchez Gual <lluis@novell.com>
* HttpCachePolicyElement.cs:
* SmtpElement.cs: Track 2.0 API changes.
2005-06-14 Lluis Sanchez Gual <lluis@novell.com>
* SettingsSection.cs, UriParserElement.cs, MailSettingsSection.cs,
RequestCachingSection.cs, SmtpElement.cs, AuthenticationModulesSection.cs,
Ipv6Element.cs, ModuleElement.cs, AuthenticationModuleElement.cs,
UriParserSection.cs, SocketElement.cs, ConnectionManagementElement.cs,
WebRequestModuleElement.cs, DefaultProxySection.cs, BypassElement.cs,
ServicePointManagerElement.cs, ConnectionManagementSection.cs,
ProxyElement.cs, HttpCachePolicyElement.cs, HttpWebRequestElement.cs,
WebRequestModulesSection.cs:
Changed properties from "internal protected" to "protected", since
configuration classes have been moved to a new assembly.
2004-09-10 Tim Coleman <tim@timcoleman.com>
* AuthenticationModuleElement.cs AuthenticationModuleElementCollection.cs
* AuthenticationModulesSection.cs BypassElement.cs BypassElementCollection.cs
* ConnectionManagementElement.cs ConnectionManagementElementCollection.cs
* ConnectionManagementSection.cs DefaultProxySection.cs
* HttpCachePolicyElement.cs HttpWebRequestElement.cs
* Ipv6Element.cs MailSettingsSection.cs ModuleElement.cs
* NetSectionGroup.cs ProxyElement.cs RequestCachingSection.cs
* ServicePointManagerElement.cs SettingsSection.cs SmtpElement.cs
* SocketElement.cs UriParserElement.cs UriParserElementCollection.cs
* UriParserSection.cs WebRequestModuleElement.cs
* WebRequestModuleElementCollection.cs WebRequestModulesSection.cs:
New classes for Fx 2.0
2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* DefaultProxyHandler.cs: removed Console.WriteLine's.
2004-05-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* NetConfigurationHandler.cs: process the httpWebRequest node too.
Better error checking.
2003-10-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ConnectionManagementHandler.cs: the hashtable is case insensitive now.
2003-10-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ConnectionManagementHandler.cs: added GetMaxConnections to return the
max. number of simultaneous connections to a given host.
2003-07-14 Jerome Laban <jlaban@wanadoo.fr>
* NetConfigurationHandler.cs: New file that handles
system.net/settings
2003-06-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* NetAuthenticationModuleHandler.cs: register the modules using
AuthenticationManager.
2003-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* WebRequestModuleHandler.cs: handles system.net/webRequestModules
configuration section.
2003-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* DefaultProxyHandler.cs: new file.
* NetAuthenticationModuleHandler.cs: new file.
Reworked HttpWebRequest and related classes.
2003-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ConnectionManagementHandler.cs: New file that handles
system.net/connectionManagement section.

View File

@@ -0,0 +1,97 @@
//
// System.Net.Configuration.ConnectionManagementElement.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class ConnectionManagementElement : ConfigurationElement
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty addressProp;
static ConfigurationProperty maxConnectionProp;
#endregion // Fields
#region Constructors
static ConnectionManagementElement ()
{
addressProp = new ConfigurationProperty ("address", typeof (string),
null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
maxConnectionProp = new ConfigurationProperty ("maxconnection", typeof (int),
1, ConfigurationPropertyOptions.IsRequired);
properties = new ConfigurationPropertyCollection ();
properties.Add (addressProp);
properties.Add (maxConnectionProp);
}
public ConnectionManagementElement ()
{
}
public ConnectionManagementElement (string address, int maxConnection)
{
Address = address;
MaxConnection = maxConnection;
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("address", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
public string Address {
get { return (string) base [addressProp]; }
set { base [addressProp] = value; }
}
[ConfigurationProperty ("maxconnection", DefaultValue = "6", Options = ConfigurationPropertyOptions.IsRequired)]
public int MaxConnection {
get { return (int) base [maxConnectionProp]; }
set { base [maxConnectionProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
}
}
#endif

View File

@@ -0,0 +1,114 @@
//
// System.Net.Configuration.ConnectionManagementElementCollection.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
[ConfigurationCollection (typeof (ConnectionManagementElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
public sealed class ConnectionManagementElementCollection : ConfigurationElementCollection
{
#region Constructors
public ConnectionManagementElementCollection ()
{
}
#endregion // Constructors
#region Properties
[MonoTODO]
public ConnectionManagementElement this [int index] {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public new ConnectionManagementElement this [string name] {
get { return (ConnectionManagementElement) base [name]; }
set { base [name] = value; }
}
#endregion // Properties
#region Methods
public void Add (ConnectionManagementElement element)
{
BaseAdd (element);
}
public void Clear ()
{
BaseClear ();
}
protected override ConfigurationElement CreateNewElement ()
{
return new ConnectionManagementElement ();
}
protected override object GetElementKey (ConfigurationElement element)
{
if (!(element is ConnectionManagementElement))
throw new ArgumentException ("element");
return ((ConnectionManagementElement)element).Address;
}
public int IndexOf (ConnectionManagementElement element)
{
return BaseIndexOf (element);
}
public void Remove (ConnectionManagementElement element)
{
BaseRemove (element);
}
public void Remove (string name)
{
BaseRemove (name);
}
public void RemoveAt (int index)
{
BaseRemoveAt (index);
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,199 @@
//
// System.Net.Configuration.ConnectionManagementHandler
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2003 Ximian, Inc (http://www.ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Configuration;
#if (XML_DEP)
using System.Xml;
#else
using XmlNode = System.Object;
#endif
namespace System.Net.Configuration
{
class ConnectionManagementData
{
Hashtable data; // key -> address, value -> maxconnections
const int defaultMaxConnections = 2;
public ConnectionManagementData (object parent)
{
data = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
CaseInsensitiveComparer.DefaultInvariant);
if (parent != null && parent is ConnectionManagementData) {
ConnectionManagementData p = (ConnectionManagementData) parent;
foreach (string k in p.data.Keys)
data [k] = p.data [k];
}
}
public void Add (string address, string nconns)
{
if (nconns == null || nconns == "")
nconns = "2";
// Adding duplicates works fine under MS, so...
data [address] = UInt32.Parse (nconns);
}
public void Add (string address, int nconns)
{
data [address] = (uint) nconns;
}
public void Remove (string address)
{
// Removing non-existent address is fine.
data.Remove (address);
}
public void Clear ()
{
data.Clear ();
}
public uint GetMaxConnections (string hostOrIP)
{
object o = data [hostOrIP];
if (o == null)
o = data ["*"];
if (o == null)
return defaultMaxConnections;
return (uint) o;
}
public Hashtable Data {
get { return data; }
}
}
class ConnectionManagementHandler : IConfigurationSectionHandler
{
public virtual object Create (object parent, object configContext, XmlNode section)
{
ConnectionManagementData cmd = new ConnectionManagementData (parent);
#if (XML_DEP)
if (section.Attributes != null && section.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", section);
XmlNodeList httpHandlers = section.ChildNodes;
foreach (XmlNode child in httpHandlers) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "clear") {
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
cmd.Clear ();
continue;
}
//LAMESPEC: the MS doc says that <remove name="..."/> but they throw an exception
// if you use that. "address" is correct.
string address = HandlersUtil.ExtractAttributeValue ("address", child);
if (name == "add") {
string maxcnc = HandlersUtil.ExtractAttributeValue ("maxconnection", child, true);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
cmd.Add (address, maxcnc);
continue;
}
if (name == "remove") {
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
cmd.Remove (address);
continue;
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
#endif
return cmd;
}
}
internal class HandlersUtil
{
private HandlersUtil ()
{
}
#if (XML_DEP)
static internal string ExtractAttributeValue (string attKey, XmlNode node)
{
return ExtractAttributeValue (attKey, node, false);
}
static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional)
{
if (node.Attributes == null) {
if (optional)
return null;
ThrowException ("Required attribute not found: " + attKey, node);
}
XmlNode att = node.Attributes.RemoveNamedItem (attKey);
if (att == null) {
if (optional)
return null;
ThrowException ("Required attribute not found: " + attKey, node);
}
string value = att.Value;
if (value == String.Empty) {
string opt = optional ? "Optional" : "Required";
ThrowException (opt + " attribute is empty: " + attKey, node);
}
return value;
}
static internal void ThrowException (string msg, XmlNode node)
{
if (node != null && node.Name != String.Empty)
msg = msg + " (node name: " + node.Name + ") ";
throw new ConfigurationException (msg, node);
}
#endif
}
}

View File

@@ -0,0 +1,80 @@
//
// System.Net.Configuration.ConnectionManagementSection.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class ConnectionManagementSection : ConfigurationSection
{
#region Fields
static ConfigurationProperty connectionManagementProp;
static ConfigurationPropertyCollection properties;
#endregion // Fields
#region Constructors
static ConnectionManagementSection ()
{
connectionManagementProp = new ConfigurationProperty ("ConnectionManagement", typeof (ConnectionManagementElementCollection),
null, ConfigurationPropertyOptions.IsDefaultCollection);
properties = new ConfigurationPropertyCollection ();
properties.Add (connectionManagementProp);
}
public ConnectionManagementSection ()
{
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public ConnectionManagementElementCollection ConnectionManagement {
get { return (ConnectionManagementElementCollection) base [connectionManagementProp]; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
}
}
#endif

View File

@@ -0,0 +1,180 @@
//
// System.Net.Configuration.DefaultProxyHandler
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2003 Ximian, Inc (http://www.ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Configuration;
#if (XML_DEP)
using System.Xml;
#else
using XmlNode = System.Object;
#endif
namespace System.Net.Configuration
{
class DefaultProxyHandler : IConfigurationSectionHandler
{
public virtual object Create (object parent, object configContext, XmlNode section)
{
IWebProxy result = parent as IWebProxy;
#if (XML_DEP)
if (section.Attributes != null && section.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", section);
XmlNodeList nodes = section.ChildNodes;
foreach (XmlNode child in nodes) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "proxy") {
string sysdefault = HandlersUtil.ExtractAttributeValue ("usesystemdefault", child, true);
string bypass = HandlersUtil.ExtractAttributeValue ("bypassonlocal", child, true);
string address = HandlersUtil.ExtractAttributeValue ("proxyaddress", child, true);
if (child.Attributes != null && child.Attributes.Count != 0) {
HandlersUtil.ThrowException ("Unrecognized attribute", child);
}
result = new WebProxy ();
bool bp = (bypass != null && String.Compare (bypass, "true", true) == 0);
if (bp == false) {
if (bypass != null && String.Compare (bypass, "false", true) != 0)
HandlersUtil.ThrowException ("Invalid boolean value", child);
}
if (!(result is WebProxy))
continue;
((WebProxy) result).BypassProxyOnLocal = bp;
if (address != null)
try {
((WebProxy) result).Address = new Uri (address);
continue;
} catch (UriFormatException) {} //MS: ignore bad URIs, fall through to default
//MS: presence of valid address URI takes precedence over usesystemdefault
if (sysdefault != null && String.Compare (sysdefault, "true", true) == 0) {
address = Environment.GetEnvironmentVariable ("http_proxy");
if (address == null)
address = Environment.GetEnvironmentVariable ("HTTP_PROXY");
if (address != null) {
try {
Uri uri = new Uri (address);
IPAddress ip;
if (IPAddress.TryParse (uri.Host, out ip)) {
if (IPAddress.Any.Equals (ip)) {
UriBuilder builder = new UriBuilder (uri);
builder.Host = "127.0.0.1";
uri = builder.Uri;
} else if (IPAddress.IPv6Any.Equals (ip)) {
UriBuilder builder = new UriBuilder (uri);
builder.Host = "[::1]";
uri = builder.Uri;
}
}
((WebProxy) result).Address = uri;
} catch (UriFormatException) { }
}
}
continue;
}
if (name == "bypasslist") {
if (!(result is WebProxy))
continue;
FillByPassList (child, (WebProxy) result);
continue;
}
if (name == "module") {
HandlersUtil.ThrowException ("WARNING: module not implemented yet", child);
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
#endif
return result;
}
#if (XML_DEP)
static void FillByPassList (XmlNode node, WebProxy proxy)
{
ArrayList bypass = new ArrayList (proxy.BypassArrayList);
if (node.Attributes != null && node.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", node);
XmlNodeList nodes = node.ChildNodes;
foreach (XmlNode child in nodes) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "add") {
string address = HandlersUtil.ExtractAttributeValue ("address", child);
if (!bypass.Contains (address)) {
bypass.Add (address);
}
continue;
}
if (name == "remove") {
string address = HandlersUtil.ExtractAttributeValue ("address", child);
bypass.Remove (address);
continue;
}
if (name == "clear") {
if (node.Attributes != null && node.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", node);
bypass.Clear ();
continue;
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
proxy.BypassList = (string []) bypass.ToArray (typeof (string));
}
#endif
}
}

View File

@@ -0,0 +1,125 @@
//
// System.Net.Configuration.DefaultProxySection.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class DefaultProxySection : ConfigurationSection
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty bypassListProp;
static ConfigurationProperty enabledProp;
static ConfigurationProperty moduleProp;
static ConfigurationProperty proxyProp;
static ConfigurationProperty useDefaultCredentialsProp;
#endregion // Fields
#region Constructors
static DefaultProxySection ()
{
bypassListProp = new ConfigurationProperty ("bypasslist", typeof (BypassElementCollection), null);
enabledProp = new ConfigurationProperty ("enabled", typeof (bool), true);
moduleProp = new ConfigurationProperty ("module", typeof (ModuleElement), null);
proxyProp = new ConfigurationProperty ("proxy", typeof (ProxyElement), null);
useDefaultCredentialsProp = new ConfigurationProperty ("useDefaultCredentials", typeof (bool), false);
properties = new ConfigurationPropertyCollection ();
properties.Add (bypassListProp);
properties.Add (moduleProp);
properties.Add (proxyProp);
}
public DefaultProxySection ()
{
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("bypasslist")]
public BypassElementCollection BypassList {
get { return (BypassElementCollection) base [bypassListProp]; }
}
[ConfigurationProperty ("enabled", DefaultValue = "True")]
public bool Enabled {
get { return (bool) base [enabledProp]; }
set { base [enabledProp] = value; }
}
[ConfigurationProperty ("module")]
public ModuleElement Module {
get { return (ModuleElement) base [moduleProp]; }
}
[ConfigurationProperty ("proxy")]
public ProxyElement Proxy {
get { return (ProxyElement) base [proxyProp]; }
}
[ConfigurationProperty ("useDefaultCredentials", DefaultValue = "False")]
public bool UseDefaultCredentials {
get { return (bool) base [useDefaultCredentialsProp]; }
set { base [useDefaultCredentialsProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
#region Methods
[MonoTODO]
protected override void PostDeserialize ()
{
}
[MonoTODO]
protected override void Reset (ConfigurationElement parentElement)
{
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,97 @@
//
// System.Net.Configuration.HttpCachePolicyElement.cs
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
// (C) 2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System;
using System.Configuration;
using System.Net.Cache;
using System.Xml;
namespace System.Net.Configuration
{
public sealed class FtpCachePolicyElement : ConfigurationElement
{
#region Fields
static ConfigurationProperty policyLevelProp;
static ConfigurationPropertyCollection properties;
#endregion // Fields
#region Constructors
static FtpCachePolicyElement ()
{
policyLevelProp = new ConfigurationProperty ("policyLevel", typeof (RequestCacheLevel), RequestCacheLevel.Default);
properties = new ConfigurationPropertyCollection ();
properties.Add (policyLevelProp);
}
public FtpCachePolicyElement ()
{
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("policyLevel", DefaultValue = "Default")]
public RequestCacheLevel PolicyLevel {
get { return (RequestCacheLevel) base [policyLevelProp]; }
set { base [policyLevelProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
#region Methods
[MonoTODO]
protected override void DeserializeElement (XmlReader reader, bool serializeCollectionKey)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void Reset (ConfigurationElement parentElement)
{
throw new NotImplementedException ();
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,127 @@
//
// System.Net.Configuration.HttpCachePolicyElement.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System;
using System.Configuration;
using System.Net.Cache;
using System.Xml;
namespace System.Net.Configuration
{
public sealed class HttpCachePolicyElement : ConfigurationElement
{
#region Fields
static ConfigurationProperty maximumAgeProp;
static ConfigurationProperty maximumStaleProp;
static ConfigurationProperty minimumFreshProp;
static ConfigurationProperty policyLevelProp;
static ConfigurationPropertyCollection properties;
#endregion // Fields
#region Constructors
static HttpCachePolicyElement ()
{
maximumAgeProp = new ConfigurationProperty ("maximumAge", typeof (TimeSpan), TimeSpan.MaxValue);
maximumStaleProp = new ConfigurationProperty ("maximumStale", typeof (TimeSpan), TimeSpan.MinValue);
minimumFreshProp = new ConfigurationProperty ("minimumFresh", typeof (TimeSpan), TimeSpan.MinValue);
policyLevelProp = new ConfigurationProperty ("policyLevel", typeof (HttpRequestCacheLevel),
HttpRequestCacheLevel.Default, ConfigurationPropertyOptions.IsRequired);
properties = new ConfigurationPropertyCollection ();
properties.Add (maximumAgeProp);
properties.Add (maximumStaleProp);
properties.Add (minimumFreshProp);
properties.Add (policyLevelProp);
}
public HttpCachePolicyElement ()
{
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("maximumAge", DefaultValue = "10675199.02:48:05.4775807")]
public TimeSpan MaximumAge {
get { return (TimeSpan) base [maximumAgeProp]; }
set { base [maximumAgeProp] = value; }
}
[ConfigurationProperty ("maximumStale", DefaultValue = "-10675199.02:48:05.4775808")]
public TimeSpan MaximumStale {
get { return (TimeSpan) base [maximumStaleProp]; }
set { base [maximumStaleProp] = value; }
}
[ConfigurationProperty ("minimumFresh", DefaultValue = "-10675199.02:48:05.4775808")]
public TimeSpan MinimumFresh {
get { return (TimeSpan) base [minimumFreshProp]; }
set { base [minimumFreshProp] = value; }
}
[ConfigurationProperty ("policyLevel", DefaultValue = "Default", Options = ConfigurationPropertyOptions.IsRequired)]
public HttpRequestCacheLevel PolicyLevel {
get { return (HttpRequestCacheLevel) base [policyLevelProp]; }
set { base [policyLevelProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
#region Methods
[MonoTODO]
protected override void DeserializeElement (XmlReader reader, bool serializeCollectionKey)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void Reset (ConfigurationElement parentElement)
{
throw new NotImplementedException ();
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,118 @@
//
// System.Net.Configuration.HttpWebRequestElement.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class HttpWebRequestElement : ConfigurationElement
{
#region Fields
static ConfigurationProperty maximumErrorResponseLengthProp;
static ConfigurationProperty maximumResponseHeadersLengthProp;
static ConfigurationProperty maximumUnauthorizedUploadLengthProp;
static ConfigurationProperty useUnsafeHeaderParsingProp;
static ConfigurationPropertyCollection properties;
#endregion // Fields
#region Constructors
static HttpWebRequestElement ()
{
maximumErrorResponseLengthProp = new ConfigurationProperty ("maximumErrorResponseLength", typeof (int), 64);
maximumResponseHeadersLengthProp = new ConfigurationProperty ("maximumResponseHeadersLength", typeof (int), 64);
maximumUnauthorizedUploadLengthProp = new ConfigurationProperty ("maximumUnauthorizedUploadLength", typeof (int), -1);
useUnsafeHeaderParsingProp = new ConfigurationProperty ("useUnsafeHeaderParsing", typeof (bool), false);
properties = new ConfigurationPropertyCollection ();
properties.Add (maximumErrorResponseLengthProp);
properties.Add (maximumResponseHeadersLengthProp);
properties.Add (maximumUnauthorizedUploadLengthProp);
properties.Add (useUnsafeHeaderParsingProp);
}
public HttpWebRequestElement ()
{
}
#endregion // Constructors
#region Properties
[ConfigurationProperty("maximumErrorResponseLength", DefaultValue = "64")]
public int MaximumErrorResponseLength {
get { return (int) base[maximumErrorResponseLengthProp]; }
set { base [maximumErrorResponseLengthProp] = value; }
}
[ConfigurationProperty("maximumResponseHeadersLength", DefaultValue = "64")]
public int MaximumResponseHeadersLength {
get { return (int) base [maximumResponseHeadersLengthProp]; }
set { base [maximumResponseHeadersLengthProp] = value; }
}
[ConfigurationProperty("maximumUnauthorizedUploadLength", DefaultValue = "-1")]
public int MaximumUnauthorizedUploadLength {
get { return (int) base [maximumUnauthorizedUploadLengthProp]; }
set { base [maximumUnauthorizedUploadLengthProp] = value; }
}
[ConfigurationProperty("useUnsafeHeaderParsing", DefaultValue = "False")]
public bool UseUnsafeHeaderParsing {
get { return (bool) base [useUnsafeHeaderParsingProp]; }
set { base[useUnsafeHeaderParsingProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
#region Methods
[MonoTODO]
protected override void PostDeserialize ()
{
base.PostDeserialize ();
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,79 @@
//
// System.Net.Configuration.Ipv6Element.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class Ipv6Element : ConfigurationElement
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty enabledProp;
#endregion // Fields
#region Constructors
static Ipv6Element ()
{
enabledProp = new ConfigurationProperty ("enabled", typeof (bool), false);
properties = new ConfigurationPropertyCollection ();
properties.Add (enabledProp);
}
public Ipv6Element ()
{
}
#endregion // Constructors
#region Properties
[ConfigurationProperty ("enabled", DefaultValue = "False")]
public bool Enabled {
get { return (bool) base [enabledProp]; }
set { base [enabledProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
#endregion // Properties
}
}
#endif

View File

@@ -0,0 +1,47 @@
//
// System.Net.Configuration.MailSettingsSectionGroup
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
// (C) 2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class MailSettingsSectionGroup : ConfigurationSectionGroup
{
// for some reason MS doesn't provide a ConfigurationProperty for this property...
//[ConfigurationProperty ("smtp")]
public SmtpSection Smtp {
get { return (SmtpSection) Sections ["smtp"]; }
}
}
}
#endif

View File

@@ -0,0 +1,80 @@
//
// System.Net.Configuration.ModuleElement.cs
//
// Authors:
// Tim Coleman (tim@timcoleman.com)
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) Tim Coleman, 2004
// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System.Configuration;
namespace System.Net.Configuration
{
public sealed class ModuleElement : ConfigurationElement
{
#region Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty typeProp;
#endregion // Fields
#region Constructors
static ModuleElement ()
{
typeProp = new ConfigurationProperty ("type", typeof (string), null);
properties = new ConfigurationPropertyCollection ();
properties.Add (typeProp);
}
public ModuleElement ()
{
}
#endregion // Constructors
#region Properties
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
[ConfigurationProperty ("type")]
public string Type {
get { return (string) base [typeProp]; }
set { base [typeProp] = value; }
}
#endregion // Properties
}
}
#endif

View File

@@ -0,0 +1,107 @@
//
// System.Net.Configuration.NetAuthenticationModuleHandler
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2003 Ximian, Inc (http://www.ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Configuration;
#if (XML_DEP)
using System.Xml;
#else
using XmlNode = System.Object;
#endif
namespace System.Net.Configuration
{
class NetAuthenticationModuleHandler : IConfigurationSectionHandler
{
public virtual object Create (object parent, object configContext, XmlNode section)
{
#if (XML_DEP)
if (section.Attributes != null && section.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", section);
XmlNodeList httpHandlers = section.ChildNodes;
foreach (XmlNode child in httpHandlers) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "clear") {
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
AuthenticationManager.Clear ();
continue;
}
string type = HandlersUtil.ExtractAttributeValue ("type", child);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
if (name == "add") {
AuthenticationManager.Register (CreateInstance (type, child));
continue;
}
if (name == "remove") {
AuthenticationManager.Unregister (CreateInstance (type, child));
continue;
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
return AuthenticationManager.RegisteredModules;
#else
return null;
#endif
}
#if (XML_DEP)
static IAuthenticationModule CreateInstance (string typeName, XmlNode node)
{
IAuthenticationModule module = null;
try {
Type type = Type.GetType (typeName, true);
module = (IAuthenticationModule) Activator.CreateInstance (type);
} catch (Exception e) {
HandlersUtil.ThrowException (e.Message, node);
}
return module;
}
#endif
}
}

View File

@@ -0,0 +1,107 @@
//
// System.Net.Configuration.NetConfigurationHandler.cs
//
// Authors:
// Jerome Laban (jlaban@wanadoo.fr)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2003 Ximian, Inc (http://www.ximian.com)
// (c) 2004 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Configuration;
#if (XML_DEP)
using System.Xml;
#else
using XmlNode = System.Object;
#endif
namespace System.Net.Configuration
{
class NetConfigurationHandler : IConfigurationSectionHandler
{
public virtual object Create (object parent, object configContext, XmlNode section)
{
NetConfig config = new NetConfig ();
#if (XML_DEP)
if (section.Attributes != null && section.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", section);
XmlNodeList reqHandlers = section.ChildNodes;
foreach (XmlNode child in reqHandlers) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "ipv6") {
string enabled = HandlersUtil.ExtractAttributeValue ("enabled", child, false);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
if (enabled == "true")
config.ipv6Enabled = true;
else if (enabled != "false")
HandlersUtil.ThrowException ("Invalid boolean value", child);
continue;
}
if (name == "httpWebRequest") {
string max = HandlersUtil.ExtractAttributeValue
("maximumResponseHeadersLength", child, true);
// this one is just ignored
HandlersUtil.ExtractAttributeValue ("useUnsafeHeaderParsing", child, true);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
try {
if (max != null) {
int val = Int32.Parse (max.Trim ());
if (val < -1)
HandlersUtil.ThrowException ("Must be -1 or >= 0", child);
config.MaxResponseHeadersLength = val;
}
} catch {
HandlersUtil.ThrowException ("Invalid int value", child);
}
continue;
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
#endif
return config;
}
}
}

Some files were not shown because too many files have changed in this diff Show More