    # File lib/rack/handler/mongrel.rb, line 61
          def process(request, response)
            env = Hash[request.params]
            env.delete "HTTP_CONTENT_TYPE"
            env.delete "HTTP_CONTENT_LENGTH"

            env["SCRIPT_NAME"] = ""  if env["SCRIPT_NAME"] == "/"

            rack_input = request.body || StringIO.new('')
            rack_input.set_encoding(Encoding::BINARY) if rack_input.respond_to?(:set_encoding)

            env.update({"rack.version" => Rack::VERSION,
                         "rack.input" => rack_input,
                         "rack.errors" => $stderr,

                         "rack.multithread" => true,
                         "rack.multiprocess" => false, # ???
                         "rack.run_once" => false,

                         "rack.url_scheme" => ["yes", "on", "1"].include?(env["HTTPS"]) ? "https" : "http"
                       })
            env[QUERY_STRING] ||= ""

            status, headers, body = @app.call(env)

            begin
              response.status = status.to_i
              response.send_status(nil)

              headers.each { |k, vs|
                vs.split("\n").each { |v|
                  response.header[k] = v
                }
              }
              response.send_header

              body.each { |part|
                response.write part
                response.socket.flush
              }
            ensure
              body.close  if body.respond_to? :close
            end
          end