This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 366cc3d  THRIFT-4854 oneway calls do not work over HTTP Client: netstd 
Patch: Jens Geyer
366cc3d is described below

commit 366cc3dee0f279b652644ae96b05fabd6fae2e06
Author: Jens Geyer <[email protected]>
AuthorDate: Sun Apr 28 19:53:32 2019 +0200

    THRIFT-4854 oneway calls do not work over HTTP
    Client: netstd
    Patch: Jens Geyer
    
    This closes #1790
---
 lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 @@ namespace Thrift.Transport.Server
 
                 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

Reply via email to