about summary refs log tree commit homepage
path: root/lib/rainbows
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-04-11 07:53:57 +0000
committerEric Wong <normalperson@yhbt.net>2011-04-11 07:53:57 +0000
commita1168e7d2bfe182896f139d051ef099616fd1646 (patch)
tree7044248ee4c810514fb87221fb460e7f4a7e180c /lib/rainbows
parent321e3dfbd5c4a585c00a8d5221ebdf9b934aaea1 (diff)
downloadrainbows-a1168e7d2bfe182896f139d051ef099616fd1646.tar.gz
Diffstat (limited to 'lib/rainbows')
-rw-r--r--lib/rainbows/epoll/client.rb3
-rw-r--r--lib/rainbows/epoll/response_chunk_pipe.rb2
-rw-r--r--lib/rainbows/epoll/response_pipe.rb5
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/rainbows/epoll/client.rb b/lib/rainbows/epoll/client.rb
index 3ef51b3..924d32f 100644
--- a/lib/rainbows/epoll/client.rb
+++ b/lib/rainbows/epoll/client.rb
@@ -207,7 +207,8 @@ module Rainbows::Epoll::Client
   # this alternates between a push and pull model from the pipe -> client
   # to avoid having too much data in userspace on either end.
   def stream_pipe(pipe)
-    case buf = pipe.tryread
+    buf = ""
+    case buf = pipe.tryread(buf)
     when String
       write(buf)
       if @wr_queue[0]
diff --git a/lib/rainbows/epoll/response_chunk_pipe.rb b/lib/rainbows/epoll/response_chunk_pipe.rb
index 3ad57a8..146f5cb 100644
--- a/lib/rainbows/epoll/response_chunk_pipe.rb
+++ b/lib/rainbows/epoll/response_chunk_pipe.rb
@@ -2,7 +2,7 @@
 # :enddoc:
 #
 class Rainbows::Epoll::ResponseChunkPipe < Rainbows::Epoll::ResponsePipe
-  def tryread
+  def tryread(buf)
     @io or return
 
     case rv = super
diff --git a/lib/rainbows/epoll/response_pipe.rb b/lib/rainbows/epoll/response_pipe.rb
index 56d9a47..6bd31cf 100644
--- a/lib/rainbows/epoll/response_pipe.rb
+++ b/lib/rainbows/epoll/response_pipe.rb
@@ -4,7 +4,6 @@
 class Rainbows::Epoll::ResponsePipe
   attr_reader :io
   alias to_io io
-  RBUF = Rainbows::EvCore::RBUF
   EP = Rainbows::Epoll::EP
 
   def initialize(io, client, body)
@@ -26,7 +25,7 @@ class Rainbows::Epoll::ResponsePipe
     @io = @body = nil
   end
 
-  def tryread
-    Kgio.tryread(@io, 16384, RBUF)
+  def tryread(buf)
+    Kgio.tryread(@io, 16384, buf)
   end
 end