diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rainbows/epoll/client.rb | 3 | ||||
-rw-r--r-- | lib/rainbows/epoll/response_chunk_pipe.rb | 2 | ||||
-rw-r--r-- | lib/rainbows/epoll/response_pipe.rb | 5 |
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 |