Skip to content

Commit 837e687

Browse files
committed
Fixes #1
Had got things stuck in a loop whereby on connection close I tried to lookup the peer address for the log message; this in turn raised a new connection close. Now I'm caching the peer address from when the connection was first established.
1 parent d5d5009 commit 837e687

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/logstash/util/relp.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ def server?
9595
class RelpServer < Relp
9696

9797
def peer
98-
begin
99-
@socket.peeraddr[3]#TODO: is this the best thing to report? I don't think so...
100-
rescue IOError
101-
raise ConnectionClosed
98+
if @peer.nil?
99+
@peer = @socket.peeraddr[3]#TODO: is this the best thing to report? I don't think so...
102100
end
101+
@peer
103102
end
104103

105104
def initialize(host,port,required_commands=[])

0 commit comments

Comments
 (0)