Fixed HttpWebRequest.DefaultMaximumErrorResponseLength value that was causing problems.
authorPanagiotis Kanavos <pkanavos@gmail.com>
Mon, 2 Apr 2012 08:49:36 +0000 (11:49 +0300)
committerPanagiotis Kanavos <pkanavos@gmail.com>
Mon, 2 Apr 2012 08:49:36 +0000 (11:49 +0300)
trunk/Pithos.Network/RestClient.cs

index 5566c12..d610a15 100644 (file)
@@ -97,7 +97,9 @@ namespace Pithos.Network
         public RestClient():base()
         {
             //The maximum error response must be large because missing server hashes are return as a Conflivt (409) error response
-            HttpWebRequest.DefaultMaximumErrorResponseLength = 16*1024*1024;
+            //Any value above 2^21-1 will result in an empty response.
+            //-1 essentially ignores the maximum length
+            HttpWebRequest.DefaultMaximumErrorResponseLength = -1;
         }
 
        
@@ -108,7 +110,10 @@ namespace Pithos.Network
                 throw new ArgumentNullException("other");
             Contract.EndContractBlock();
 
-            HttpWebRequest.DefaultMaximumErrorResponseLength = 16 * 1024 * 1024;
+            //The maximum error response must be large because missing server hashes are return as a Conflivt (409) error response
+            //Any value above 2^21-1 will result in an empty response.
+            //-1 essentially ignores the maximum length
+            HttpWebRequest.DefaultMaximumErrorResponseLength = -1;
 
             CopyHeaders(other);
             Timeout = other.Timeout;