X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net.Configuration%2FHttpWebRequestElement.cs;h=9d7a6a3c26929f8703059fbc987aeeafaf3b330e;hb=c0a8ef12af1f473bfc837325581fe738f1b3178c;hp=9d8836238482e54df0c1874b865cad01e62068b0;hpb=0e8decdb3782e95107687ba03b6e858e3e283b8f;p=mono.git diff --git a/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs b/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs index 9d883623848..9d7a6a3c269 100644 --- a/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs +++ b/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs @@ -3,9 +3,10 @@ // // Authors: // Tim Coleman (tim@timcoleman.com) +// Chris Toshok (toshok@ximian.com) // // Copyright (C) Tim Coleman, 2004 -// (c) 2004 Novell, Inc. (http://www.novell.com) +// (C) 2004,2005 Novell, Inc. (http://www.novell.com) // // @@ -27,9 +28,9 @@ // 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 NET_2_0 && XML_DEP +#if CONFIGURATION_DEP using System.Configuration; @@ -39,33 +40,78 @@ namespace System.Net.Configuration { #region Fields - ConfigurationPropertyCollection properties; - static ConfigurationProperty maximumResponseHeadersLength = new ConfigurationProperty ("MaximumResponseHeadersLength", typeof (int), 64); + static ConfigurationProperty maximumErrorResponseLengthProp; + static ConfigurationProperty maximumResponseHeadersLengthProp; + static ConfigurationProperty maximumUnauthorizedUploadLengthProp; + static ConfigurationProperty useUnsafeHeaderParsingProp; + static ConfigurationPropertyCollection properties; #endregion // Fields #region Constructors - public HttpWebRequestElement () + 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 (maximumResponseHeadersLength); + + properties.Add (maximumErrorResponseLengthProp); + properties.Add (maximumResponseHeadersLengthProp); + properties.Add (maximumUnauthorizedUploadLengthProp); + properties.Add (useUnsafeHeaderParsingProp); + } + + public HttpWebRequestElement () + { } #endregion // Constructors #region Properties - protected override ConfigurationPropertyCollection Properties { - get { return 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 [maximumResponseHeadersLength]; } - set { base [maximumResponseHeadersLength] = value; } + 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 } }