about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-08 07:54:30 +0000
committerEric Wong <normalperson@yhbt.net>2011-05-08 07:54:58 +0000
commitdf00f2b1028ba95450246c82e468878b6ec903a3 (patch)
tree1d15a006fd970b3f0d4e98253e5a1b00be779c2f
parented869514211a908748f04a881e6fb18a395914ae (diff)
downloadrainbows-df00f2b1028ba95450246c82e468878b6ec903a3.tar.gz
Fixed in kgio 2.4.0 now

This reverts commit a1168e7d2bfe182896f139d051ef099616fd1646.
-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 3fbd386..520eb2b 100644
--- a/lib/rainbows/epoll/client.rb
+++ b/lib/rainbows/epoll/client.rb
@@ -207,8 +207,7 @@ 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)
-    buf = ""
-    case buf = pipe.tryread(buf)
+    case buf = pipe.tryread
     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 146f5cb..3ad57a8 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(buf)
+  def tryread
     @io or return
 
     case rv = super
diff --git a/lib/rainbows/epoll/response_pipe.rb b/lib/rainbows/epoll/response_pipe.rb
index 6bd31cf..56d9a47 100644
--- a/lib/rainbows/epoll/response_pipe.rb
+++ b/lib/rainbows/epoll/response_pipe.rb
@@ -4,6 +4,7 @@
 class Rainbows::Epoll::ResponsePipe
   attr_reader :io
   alias to_io io
+  RBUF = Rainbows::EvCore::RBUF
   EP = Rainbows::Epoll::EP
 
   def initialize(io, client, body)
@@ -25,7 +26,7 @@ class Rainbows::Epoll::ResponsePipe
     @io = @body = nil
   end
 
-  def tryread(buf)
-    Kgio.tryread(@io, 16384, buf)
+  def tryread
+    Kgio.tryread(@io, 16384, RBUF)
   end
 end