epoll: fixes for Ruby 1.9.3dev
[rainbows.git] / lib / rainbows / epoll / response_chunk_pipe.rb
blob146f5cb1f74e6782457d548741d5421983045e9f
1 # -*- encoding: binary -*-
2 # :enddoc:
4 class Rainbows::Epoll::ResponseChunkPipe < Rainbows::Epoll::ResponsePipe
5   def tryread(buf)
6     @io or return
8     case rv = super
9     when String
10       "#{rv.size.to_s(16)}\r\n#{rv}\r\n"
11     when nil
12       close
13       "0\r\n\r\n"
14     else
15       rv
16     end
17   end
18 end