From bb3d776d8c07f2492ec5a3ef22184f5f59e116c7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 28 May 2009 11:40:33 -0700 Subject: Make our HttpRequest object a global constant This should be faster/cheaper than using an instance variable since it's accessed in a critical code path. Unicorn was never designed to be reentrant or thread-safe at all, either. --- lib/unicorn/http_request.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/unicorn/http_request.rb') diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 368305f..d7078a3 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -12,6 +12,8 @@ module Unicorn # class HttpRequest + attr_accessor :logger + # default parameters we merge into the request env for Rack handlers DEFAULTS = { "rack.errors" => $stderr, @@ -36,7 +38,7 @@ module Unicorn PARSER = HttpParser.new PARAMS = Hash.new - def initialize(logger) + def initialize(logger = Configurator::DEFAULT_LOGGER) @logger = logger end -- cgit v1.2.3-24-ge0c7