diff --git a/ChangeLog b/ChangeLog index db3b165663..fe8d63386c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 5 01:20:17 Hirokazu Yamamoto + + * lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close + the socket whose last-access-time is oldest. (and add new one) + Sun Jul 4 12:24:50 2004 Kouhei Sutou * lib/rss/rss.rb: added copyright header. diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index 829b9cb916..8919a946b9 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -1080,11 +1080,14 @@ module DRb return succ, result ensure - @mutex.synchronize do - if @pool.size > POOL_SIZE or ! succ - conn.close if conn + if conn + if succ + @mutex.synchronize do + @pool.unshift(conn) + @pool.pop.close while @pool.size > POOL_SIZE + end else - @pool.unshift(conn) + conn.close end end end