From e21939d776673b2f8887adf7a5c64812b7d2e98e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 30 Dec 2010 08:33:15 +0000 Subject: globally refactor Range handling for responses Rack::Utils::HeaderHash is still very expensive in Rack 1.2, especially for simple things that we want to run as fast as possible with minimal interference. HeaderHash is unnecessary for most requests that do not send Content-Range in responses. --- lib/rainbows/thread_pool.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/thread_pool.rb') diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb index f243dc5..c82e22a 100644 --- a/lib/rainbows/thread_pool.rb +++ b/lib/rainbows/thread_pool.rb @@ -41,7 +41,7 @@ module Rainbows::ThreadPool def sync_worker # :nodoc: s = LISTENERS[0] begin - c = s.kgio_accept and process_client(c) + c = s.kgio_accept and c.process_loop rescue => e Rainbows::Error.listen_loop(e) end while G.alive @@ -55,7 +55,7 @@ module Rainbows::ThreadPool # problem. On the other hand, a thundering herd may not # even incur as much overhead as an extra Mutex#synchronize ret = select(LISTENERS) and ret[0].each do |s| - s = s.kgio_tryaccept and process_client(s) + s = s.kgio_tryaccept and s.process_loop end rescue Errno::EINTR rescue => e -- cgit v1.2.3-24-ge0c7