diff options
Diffstat (limited to 'lib/rainbows/client.rb')
-rw-r--r-- | lib/rainbows/client.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rainbows/client.rb b/lib/rainbows/client.rb index 4608f53..b044f26 100644 --- a/lib/rainbows/client.rb +++ b/lib/rainbows/client.rb @@ -5,20 +5,21 @@ require "io/wait" # this class is used for most synchronous concurrency models class Rainbows::Client < Kgio::Socket include Rainbows::ProcessClient + Rainbows.config!(self, :keepalive_timeout) def read_expire - Time.now + Rainbows.keepalive_timeout + Time.now + KEEPALIVE_TIMEOUT end def kgio_wait_readable - wait Rainbows.keepalive_timeout + wait KEEPALIVE_TIMEOUT end # used for reading headers (respecting keepalive_timeout) def timed_read(buf) expire = nil begin - case rv = kgio_tryread(HBUFSIZ, buf) + case rv = kgio_tryread(CLIENT_HEADER_BUFFER_SIZE, buf) when :wait_readable return if expire && expire < Time.now expire ||= read_expire |