From 7b18633804c606e8bcccfbb44e7d7b795e777ea6 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 7 Apr 2012 23:41:30 +0000 Subject: [PATCH] * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): get keys and fetch values from it to prevent @timeout_info's error "can't add a new key into hash during iteration". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/webrick/utils.rb | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 966b72fcbb..de652b2497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Apr 8 07:26:40 2012 NARUSE, Yui + + * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): get keys + and fetch values from it to prevent @timeout_info's error + "can't add a new key into hash during iteration". + Sun Apr 8 06:51:57 2012 NARUSE, Yui * io.c (io_unread): cast as long the value for extra_max. diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb index d9c39360ee..eab2375968 100644 --- a/lib/webrick/utils.rb +++ b/lib/webrick/utils.rb @@ -175,7 +175,9 @@ module WEBrick Thread.start{ while true now = Time.now - @timeout_info.dup.each{|thread, ary| + @timeout_info.keys.each{|thread| + ary = @timeout_info[thread] + next unless ary ary.dup.each{|info| time, exception = *info interrupt(thread, info.object_id, exception) if time < now