Skip to content

Commit

Permalink
Not to enable compress forcedly
Browse files Browse the repository at this point in the history
  • Loading branch information
ganmacs committed Aug 31, 2016
1 parent d61fa8b commit 04d1366
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ def configure(conf)
log.info "adding forwarding server '#{name}'", host: host, port: port, weight: weight, plugin_id: plugin_id
}

if @compress == :gzip && @buffer.compress == :text
@buffer.compress = :gzip
elsif @compress == :text && @buffer.compress == :gzip
log.info "buffer is compressed. If you also want to save the bandwidth of a network, Add `compress` configuration in <match>"
end

if @nodes.empty?
raise ConfigError, "forward output plugin requires at least one <server> is required"
end
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_configure_gzip_compress_in_buffer
compress gzip
</buffer>
])
assert_equal :gzip, d.instance.compress
assert_equal :text, d.instance.compress
assert_equal :gzip, d.instance.buffer.compress
end

Expand Down

0 comments on commit 04d1366

Please sign in to comment.