THRIFT-4854 oneway calls do not work over HTTP
Client: netstd
Patch: Jens Geyer
This closes #1790
diff --git a/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs b/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs
index b5a500c..056300c 100644
--- a/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs
+++ b/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs
@@ -100,12 +100,13 @@
while (await Processor.ProcessAsync(input, output, cancellationToken))
{
+ if (!context.Response.HasStarted) // oneway method called
+ await context.Response.Body.FlushAsync(cancellationToken);
}
}
catch (TTransportException)
{
- // Client died, just move on
- if (!context.Response.HasStarted)
+ if (!context.Response.HasStarted) // if something goes bust, let the client know
context.Response.StatusCode = 500;
}
finally