diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-07 23:41:30 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-07 23:41:30 +0000 |
commit | 7b18633804c606e8bcccfbb44e7d7b795e777ea6 (patch) | |
tree | 8e386a27c2a918e9a0920804b4ebfdca974aa98e /lib/webrick/utils.rb | |
parent | 9ec849ee085393c2dc08dc07616184e74d81a3b5 (diff) |
* 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
Diffstat (limited to 'lib/webrick/utils.rb')
-rw-r--r-- | lib/webrick/utils.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 |