t0041: less confusing skip message
[rainbows.git] / lib / rainbows / event_machine / response_chunk_pipe.rb
blobbe980867f7d7f6e36bcfcb3adb5a13ad32d06da2
1 # -*- encoding: binary -*-
2 # :enddoc:
3 module Rainbows::EventMachine::ResponseChunkPipe
4   include Rainbows::EventMachine::ResponsePipe
6   def unbind
7     @client.write("0\r\n\r\n")
8     super
9   end
11   def notify_readable
12     case data = Kgio.tryread(@io, 16384, RBUF)
13     when String
14       @client.write("#{data.size.to_s(16)}\r\n")
15       @client.write(data)
16       @client.write("\r\n")
17     when :wait_readable
18       return
19     when nil
20       return detach
21     end while true
22   end
23 end