repo.or.cz
/
rainbows.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix "rainbows -h" and "rainbows -v"
[rainbows.git]
/
t
/
async-response-no-autochunk.ru
blob
67c6403039653c95313686b37244cdcbc7d0abed
1
use Rack::Chunked
2
use Rainbows::DevFdResponse
3
script = <<-EOF
4
for i in 0 1 2 3 4 5 6 7 8 9
5
do
6
printf '1\r\n%s\r\n' $i
7
sleep 1
8
done
9
printf '0\r\n\r\n'
10
EOF
11
12
run lambda { |env|
13
env['rainbows.autochunk'] = false
14
io = IO.popen(script, 'rb')
15
io.sync = true
16
[
17
200,
18
{
19
'Content-Type' => 'text/plain',
20
'Transfer-Encoding' => 'chunked',
21
},
22
io
23
].freeze
24
}