From e110eb38010828cf2b743a374cd5af03ee216890 Mon Sep 17 00:00:00 2001 From: Gus Cairo Date: Tue, 12 Nov 2024 12:59:48 +0000 Subject: [PATCH] Fix ordering issue --- .../GRPCNIOTransportCore/Client/GRPCClientStreamHandler.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/GRPCNIOTransportCore/Client/GRPCClientStreamHandler.swift b/Sources/GRPCNIOTransportCore/Client/GRPCClientStreamHandler.swift index fd3d932..b5ff681 100644 --- a/Sources/GRPCNIOTransportCore/Client/GRPCClientStreamHandler.swift +++ b/Sources/GRPCNIOTransportCore/Client/GRPCClientStreamHandler.swift @@ -266,6 +266,8 @@ extension GRPCClientStreamHandler { // machine) then return. if self.requestFinished { return } + self.requestFinished = true + // Write an empty data frame with the EOS flag set, to signal the RPC // request is now finished. context.write( @@ -280,7 +282,6 @@ extension GRPCClientStreamHandler { promise: nil ) context.flush() - self.requestFinished = true break loop case .awaitMoreMessages: