lib/fluent/plugin/in_http.rb in fluentd-0.10.39 vs lib/fluent/plugin/in_http.rb in fluentd-0.10.40
- old
+ new
@@ -152,11 +152,11 @@
@next_close = false
@idle = 0
@km.add(self)
- @remote_port, @remote_addr = *Socket.unpack_sockaddr_in(io.getpeername)
+ @remote_port, @remote_addr = *Socket.unpack_sockaddr_in(io.getpeername) rescue nil
end
def step_idle
@idle += 1
end
@@ -232,10 +232,10 @@
end
def on_message_complete
return if closing?
- @env['REMOTE_ADDR'] = @remote_addr
+ @env['REMOTE_ADDR'] = @remote_addr if @remote_addr
params = WEBrick::HTTPUtils.parse_query(@parser.query_string)
if @content_type =~ /^application\/x-www-form-urlencoded/
params.update WEBrick::HTTPUtils.parse_query(@body)