Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs
- index b8e28b5..a4d2aad 100644
- --- a/mcs/class/System/System.Net/WebConnection.cs
- +++ b/mcs/class/System/System.Net/WebConnection.cs
- @@ -30,6 +30,8 @@
- using System.IO;
- using System.Collections;
- +using System.Configuration;
- +using System.Net.Configuration;
- using System.Net.Sockets;
- using System.Reflection;
- using System.Security.Cryptography.X509Certificates;
- @@ -86,15 +88,32 @@ namespace System.Net
- #if MONOTOUCH
- static MethodInfo start_wwan;
- +#endif
- +
- +#if !NET_2_1
- + static bool useUnsafeHeaderParsing = false;
- + static string configKey = "system.net/settings";
- +#endif
- static WebConnection ()
- {
- +#if MONOTOUCH
- Type type = Type.GetType ("MonoTouch.ObjCRuntime.Runtime, monotouch");
- if (type != null)
- start_wwan = type.GetMethod ("StartWWAN", new Type [] { typeof (System.Uri) });
- - }
- #endif
- +#if !NET_2_1
- +#if NET_2_0 && CONFIGURATION_DEP
- + SettingsSection s = ConfigurationManager.GetSection(configKey) as SettingsSection;
- +
- + if (s != null) {
- + useUnsafeHeaderParsing = s.HttpWebRequest.UseUnsafeHeaderParsing;
- + }
- +#endif
- +#endif
- + }
- +
- public WebConnection (WebConnectionGroup group, ServicePoint sPoint)
- {
- this.sPoint = sPoint;
- @@ -458,7 +477,7 @@ namespace System.Net
- exc = e;
- }
- - if (exc != null || pos == -1) {
- + if (exc != null || (!useUnsafeHeaderParsing && pos == -1)) {
- cnc.HandleError (WebExceptionStatus.ServerProtocolViolation, exc, "ReadDone4");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment