From 704f843054f3ca32941d42972a1c7d1b144d06ad Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 May 2011 04:39:54 +0000 Subject: configurator: move validation logic over There's actually no reason we can't have these methods in Rainbows::Configurator where it's easier to document nowadays. --- lib/rainbows/client.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/rainbows/client.rb') 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 -- cgit v1.2.3-24-ge0c7