coolio+xepoll_thread*: use shutdown() for keepalive timeout
[rainbows.git] / t / large-file-response.ru
blobaaa11c930c95fa3b370f64b8c1169930b1da4022
1 # lib-large-file-response will stop running if we're not on Linux here
2 use Rack::ContentLength
3 use Rack::ContentType
4 map "/rss" do
5   run lambda { |env|
6     # on Linux, this is in kilobytes
7     GC.start if GC.respond_to?(:start)
8     ::File.read("/proc/self/status") =~ /^VmRSS:\s+(\d+)/
9     [ 200, {}, [ ($1.to_i * 1024).to_s ] ]
10   }
11 end
12 map "/pid" do
13   run lambda { |env| [ 200, {}, [ "#{Process.pid}\n" ] ] }
14 end
15 map "/" do
16   run Rack::File.new(Dir.pwd)
17 end