repo.or.cz
/
rainbows.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Ruby 1.9.3+-only cleanups
[rainbows.git]
/
lib
/
rainbows
/
epoll
/
response_chunk_pipe.rb
blob
3ad57a8c8725dabea43cb6f74cec85f1c5f4d6fa
1
# -*- encoding: binary -*-
2
# :enddoc:
3
#
4
class Rainbows::Epoll::ResponseChunkPipe < Rainbows::Epoll::ResponsePipe
5
def tryread
6
@io or return
7
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