about summary refs log tree commit homepage
path: root/lib/rainbows/coolio
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-09 04:39:54 +0000
committerEric Wong <normalperson@yhbt.net>2011-05-10 08:20:27 +0000
commit704f843054f3ca32941d42972a1c7d1b144d06ad (patch)
tree2e7fea212988a9a67b7cdfab3ef939a221448e65 /lib/rainbows/coolio
parent598525843ee1d120fd9878011ca2b6328c2cf95f (diff)
downloadrainbows-704f843054f3ca32941d42972a1c7d1b144d06ad.tar.gz
There's actually no reason we can't have these methods
in Rainbows::Configurator where it's easier to document
nowadays.
Diffstat (limited to 'lib/rainbows/coolio')
-rw-r--r--lib/rainbows/coolio/client.rb4
-rw-r--r--lib/rainbows/coolio/heartbeat.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb
index 5688730..5d2edec 100644
--- a/lib/rainbows/coolio/client.rb
+++ b/lib/rainbows/coolio/client.rb
@@ -45,7 +45,7 @@ class Rainbows::Coolio::Client < Coolio::IO
   end
 
   def on_readable
-    buf = @_io.kgio_tryread(HBUFSIZ, RBUF)
+    buf = @_io.kgio_tryread(CLIENT_HEADER_BUFFER_SIZE, RBUF)
     case buf
     when :wait_readable
     when nil # eof
@@ -134,7 +134,7 @@ class Rainbows::Coolio::Client < Coolio::IO
       close if @_write_buffer.empty?
     when :headers
       if @buf.empty?
-        buf = @_io.kgio_tryread(HBUFSIZ, RBUF) or return close
+        buf = @_io.kgio_tryread(CLIENT_HEADER_BUFFER_SIZE, RBUF) or return close
         String === buf and return on_read(buf)
         # buf == :wait_readable
         unless enabled?
diff --git a/lib/rainbows/coolio/heartbeat.rb b/lib/rainbows/coolio/heartbeat.rb
index 4657155..f58ed33 100644
--- a/lib/rainbows/coolio/heartbeat.rb
+++ b/lib/rainbows/coolio/heartbeat.rb
@@ -8,9 +8,10 @@
 class Rainbows::Coolio::Heartbeat < Coolio::TimerWatcher
   KATO = Rainbows::Coolio::KATO
   CONN = Rainbows::Coolio::CONN
+  Rainbows.config!(self, :keepalive_timeout)
 
   def on_timer
-    if (ot = Rainbows.keepalive_timeout) >= 0
+    if (ot = KEEPALIVE_TIMEOUT) >= 0
       ot = Time.now - ot
       KATO.delete_if { |client, time| time < ot and client.timeout? }
     end