From 1d8b3cfb181358ad4bcc9a2667f59dd764c54b7c Mon Sep 17 00:00:00 2001 From: Arcadiy Ivanov Date: Sat, 27 Jan 2018 17:28:27 -0500 Subject: [PATCH] Do not close connection until write is complete on failed auth PONG fixes #1834 --- lib/fluent/plugin/in_forward.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_forward.rb b/lib/fluent/plugin/in_forward.rb index 6c27c0ea6d..60f6a6cd37 100644 --- a/lib/fluent/plugin/in_forward.rb +++ b/lib/fluent/plugin/in_forward.rb @@ -199,8 +199,8 @@ def handle_connection(conn) when :pingpong success, reason_or_salt, shared_key = check_ping(msg, conn.remote_addr, user_auth_salt, nonce) unless success + conn.on(:write_complete) { |c| c.close } send_data.call(serializer, generate_pong(false, reason_or_salt, nonce, shared_key)) - conn.close next end send_data.call(serializer, generate_pong(true, reason_or_salt, nonce, shared_key))