::SCGI::Processor
(Not documented)
# File lib/rack/handler/scgi.rb, line 18 18: def initialize(settings = {}) 19: @app = Rack::Chunked.new(Rack::ContentLength.new(settings[:app])) 20: @log = Object.new 21: def @log.info(*args); end 22: def @log.error(*args); end 23: super(settings) 24: end
(Not documented)
# File lib/rack/handler/scgi.rb, line 26 26: def process_requestprocess_requestprocess_request(request, input_body, socket) 27: env = {}.replace(request) 28: env.delete "HTTP_CONTENT_TYPE" 29: env.delete "HTTP_CONTENT_LENGTH" 30: env["REQUEST_PATH"], env["QUERY_STRING"] = env["REQUEST_URI"].split('?', 2) 31: env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"] 32: env["PATH_INFO"] = env["REQUEST_PATH"] 33: env["QUERY_STRING"] ||= "" 34: env["SCRIPT_NAME"] = "" 35: env.update({"rack.version" => [0,1], 36: "rack.input" => StringIO.new(input_body), 37: "rack.errors" => $stderr, 38: 39: "rack.multithread" => true, 40: "rack.multiprocess" => true, 41: "rack.run_once" => false, 42: 43: "rack.url_scheme" => ["yes", "on", "1"].include?(env["HTTPS"]) ? "https" : "http" 44: }) 45: status, headers, body = app.call(env) 46: begin 47: socket.write("Status: #{status}\r\n") 48: headers.each do |k, vs| 49: vs.split("\n").each { |v| socket.write("#{k}: #{v}\r\n")} 50: end 51: socket.write("\r\n") 52: body.each {|s| socket.write(s)} 53: ensure 54: body.close if body.respond_to? :close 55: end 56: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.