Class: ActionController::CgiResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/railsbench/write_headers_only.rb

Instance Method Summary collapse

Instance Method Details

#out(output = $stdout) ⇒ Object

on windows it is sometimes necessary to turn off writing output to avoid out of memory errors running under the console



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/railsbench/write_headers_only.rb', line 4

def out(output = $stdout)
  convert_content_type!(@headers)
  output.binmode      if output.respond_to?(:binmode)
  output.sync = false if output.respond_to?(:sync=)
  begin
    output.write(@cgi.header(@headers))
    output.flush if output.respond_to?(:flush)
  rescue Errno::EPIPE => e
    # lost connection to the FCGI process -- ignore the output, then
  end
end