THRIFT-1159:THttpClient->Flush() issue (connection thru proxy)
Client: csharp
Patch: Joshua Samuel + Alex Gaas

Resolve HttpClient flush issues with proxy.



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1339934 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/csharp/src/Transport/THttpClient.cs b/lib/csharp/src/Transport/THttpClient.cs
index 106f840..c875a43 100644
--- a/lib/csharp/src/Transport/THttpClient.cs
+++ b/lib/csharp/src/Transport/THttpClient.cs
@@ -32,13 +32,21 @@
 		private readonly Uri uri;
 		private Stream inputStream;
 		private MemoryStream outputStream = new MemoryStream();
-		private int connectTimeout = 0;
-		private int readTimeout = 0;
+
+        // Timeouts in milliseconds
+        private int connectTimeout = 30000;
+
+        private int readTimeout = 30000;
+
 		private IDictionary<String, String> customHeaders = new Dictionary<string, string>();
 
+        private HttpWebRequest connection = null;
+        private IWebProxy proxy = WebRequest.DefaultWebProxy;
+
 		public THttpClient(Uri u)
 		{
 			uri = u;
+            connection = CreateRequest();
 		}
 
 		public int ConnectTimeout
@@ -65,6 +73,14 @@
 			}
 		}
 
+        public IWebProxy Proxy
+        {
+            set
+            {
+                proxy = value;
+            }
+        }
+
 		public override bool IsOpen
 		{
 			get
@@ -192,7 +208,7 @@
 			}
 
 #if !SILVERLIGHT
-			connection.Proxy = null;
+            connection.Proxy = proxy;
 #endif
 
             return connection;