THRIFT-834. csharp: THttpClient resends contents of message after transport errors
This patch causes the send buffer to be refreshed even in the case of errors.
Patch: Anatoly Fayngelerin
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@983067 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/csharp/src/Transport/THttpClient.cs b/lib/csharp/src/Transport/THttpClient.cs
index d5d4abc..bf6ca4d 100644
--- a/lib/csharp/src/Transport/THttpClient.cs
+++ b/lib/csharp/src/Transport/THttpClient.cs
@@ -121,8 +121,14 @@
public override void Flush()
{
- SendRequest();
- outputStream = new MemoryStream();
+ try
+ {
+ SendRequest();
+ }
+ finally
+ {
+ outputStream = new MemoryStream();
+ }
}
private void SendRequest()