[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] [mono/mono] 1258d11f: Allow forcing HTTP protocol
From:       "Gonzalo Paniagua Javier (gonzalo.mono () gmail ! com)"
Date:       2011-01-31 15:50:07
Message-ID: 20110131155007.2457C22125 () mono ! ximian ! com
[Download RAW message or body]


   Branch: refs/heads/mono-2-10
     Home: https://github.com/mono/mono

   Commit: 1258d11fc3447687fcda720e23a8060d503d4f46
   Author: Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>
     Date: 01/31/2011 10:49:40
      URL: https://github.com/mono/mono/commit/1258d11fc3447687fcda720e23a8060d503d4f46


Allow forcing HTTP protocol version

	If the version is manually set, ignore the version from the service
	point when set.

	Fixes bug #668199.

Changed paths:
 M mcs/class/System/System.Net/HttpWebRequest.cs

Modified: mcs/class/System/System.Net/HttpWebRequest.cs
===================================================================
--- a/mcs/class/System/System.Net/HttpWebRequest.cs
+++ b/mcs/class/System/System.Net/HttpWebRequest.cs
@@ -75,6 +75,7 @@ namespace System.Net
 		bool preAuthenticate;
 		bool usedPreAuth;
 		Version version = HttpVersion.Version11;
+		bool force_version;
 		Version actualVersion;
 		IWebProxy proxy;
 		bool sendChunked;
@@ -450,6 +451,7 @@ namespace System.Net
 				if (value != HttpVersion.Version10 && value != HttpVersion.Version11)
 					throw new ArgumentException ("value");
 
+				force_version = true;
 				version = value; 
 			}
 		}
@@ -1073,7 +1075,7 @@ namespace System.Net
 									   actualUri.PathAndQuery);
 			}
 			
-			if (servicePoint.ProtocolVersion != null && servicePoint.ProtocolVersion < \
version) { +			if (!force_version && servicePoint.ProtocolVersion != null && \
servicePoint.ProtocolVersion < version) {  actualVersion = \
servicePoint.ProtocolVersion;  } else {
 				actualVersion = version;




_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic