about summary refs log tree commit homepage
path: root/t/fast-pipe-response.ru
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-19 10:09:53 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-19 17:04:23 -0700
commit549b25fd501b0df4a4a8b5edccde6101edb0cd63 (patch)
treed0ba43edb1b6ca84a4f89207dcc7397e57c3a9c8 /t/fast-pipe-response.ru
parent12205e29b29f844295d1794bfe10634646541f20 (diff)
downloadrainbows-549b25fd501b0df4a4a8b5edccde6101edb0cd63.tar.gz
Using EM.enable_proxy with EM.attach seems to cause
EM::Connection#receive_data callbacks to be fired before the
proxy has a chance to act, leading the first few chunks of data
being lost in the default receive_data handler.  Instead
just rely on EM.watch like the chunked pipe.
Diffstat (limited to 't/fast-pipe-response.ru')
-rw-r--r--t/fast-pipe-response.ru12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/fast-pipe-response.ru b/t/fast-pipe-response.ru
new file mode 100644
index 0000000..01f4d59
--- /dev/null
+++ b/t/fast-pipe-response.ru
@@ -0,0 +1,12 @@
+# must be run without Rack::Lint since that clobbers to_path
+use Rainbows::DevFdResponse
+run(lambda { |env|
+  env['rainbows.autochunk'] = false
+  [ 200,
+    {
+      'X-Rainbows-Autochunk' => 'no',
+      'Content-Length' => ::File.stat('random_blob').size.to_s,
+      'Content-Type' => 'application/octet-stream',
+    },
+    IO.popen('cat random_blob', 'rb') ]
+})