about summary refs log tree commit homepage
path: root/lib/unicorn/http_request.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-05-28 11:40:33 -0700
committerEric Wong <normalperson@yhbt.net>2009-05-28 11:45:15 -0700
commitbb3d776d8c07f2492ec5a3ef22184f5f59e116c7 (patch)
tree9b8d59671de7c92578107033a9fc865779c0c44b /lib/unicorn/http_request.rb
parent18c4ade90959d4eaa0048e83f3ce1052fa8a5905 (diff)
downloadunicorn-bb3d776d8c07f2492ec5a3ef22184f5f59e116c7.tar.gz
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.
Diffstat (limited to 'lib/unicorn/http_request.rb')
-rw-r--r--lib/unicorn/http_request.rb4
1 files changed, 3 insertions, 1 deletions
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