From 5f3036814675f606d8d9ea409d9883e4061793ec Mon Sep 17 00:00:00 2001 From: Artem Redkin Date: Mon, 18 May 2020 18:11:50 +0100 Subject: [PATCH] don't flush on every body part --- Sources/AsyncHTTPClient/HTTPHandler.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/AsyncHTTPClient/HTTPHandler.swift b/Sources/AsyncHTTPClient/HTTPHandler.swift index 6adb55342..721874da8 100644 --- a/Sources/AsyncHTTPClient/HTTPHandler.swift +++ b/Sources/AsyncHTTPClient/HTTPHandler.swift @@ -767,9 +767,10 @@ extension TaskHandler: ChannelDuplexHandler { return body.stream(HTTPClient.Body.StreamWriter { part in context.eventLoop.assertInEventLoop() - return context.writeAndFlush(self.wrapOutboundOut(.body(part))).map { + context.write(self.wrapOutboundOut(.body(part))).whenSuccess { self.callOutToDelegateFireAndForget(value: part, self.delegate.didSendRequestPart) } + return context.eventLoop.makeSucceededFuture(()) }) }