ircbot.rb: fix reconnect logic mogurakun/ruby_19_fixes
authorfranz <Franz.Netykafka@runbox.com>
Tue, 20 Oct 2009 07:13:55 +0000 (09:13 +0200)
committerfranz <Franz.Netykafka@runbox.com>
Tue, 20 Oct 2009 07:13:55 +0000 (09:13 +0200)
commitb2152a0142ad536ff3d3868974620535203a7e8c
tree7dd94277b046b5569f0850c14d9f09f054a0f846
parent34032a1bf515329ec24ea50d6ebf32ef498faef0
ircbot.rb: fix reconnect logic

connect calls stop_server_pings, which resets @last_rec, and if
@socket.connect raises exception, @last_rec remains nil, and reconnect
will not wait for next try, causing hundreds of reconnect tries per
second, which the logger thread cannot process fast enough, leading
to memory leaks (growing $log_queue).
lib/rbot/ircbot.rb