diff options
Diffstat (limited to 'lib/rainbows/base.rb')
-rw-r--r-- | lib/rainbows/base.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index 435c818..2627719 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -59,6 +59,10 @@ module Rainbows::Base module_function :write_body + def wait_headers_readable(client) + IO.select([client], nil, nil, G.kato) + end + # once a client is accepted, it is processed in its entirety here # in 3 easy steps: read request, call app, write app response # this is used by synchronous concurrency models @@ -72,7 +76,7 @@ module Rainbows::Base begin # loop until hp.headers(env, buf) - IO.select([client], nil, nil, G.kato) or return + wait_headers_readable(client) or return buf << client.readpartial(CHUNK_SIZE) end |