Skip to content

Commit

Permalink
Use readpartial for SSLSocket to avoid blocking read
Browse files Browse the repository at this point in the history
  • Loading branch information
repeatedly committed May 10, 2017
1 parent a8e7119 commit 751f843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def on_heartbeat(sockaddr, msg)
# return chunk id to be committed
def read_ack_from_sock(sock, unpacker)
begin
raw_data = sock.instance_of?(Fluent::PluginHelper::Socket::WrappedSocket::TLS) ? sock.read(@read_length) : sock.recv(@read_length)
raw_data = sock.instance_of?(Fluent::PluginHelper::Socket::WrappedSocket::TLS) ? sock.readpartial(@read_length) : sock.recv(@read_length)
rescue Errno::ECONNRESET
raw_data = ""
end
Expand Down

0 comments on commit 751f843

Please sign in to comment.