diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-09-05 19:33:33 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-07 16:45:43 -0700 |
commit | 3547efe6386bb4ad224be49b723d16cde2067f9c (patch) | |
tree | 6fcb9d3319d56552e16ccb18c46d1b5e516c2a09 /lib/clogger/pure.rb | |
parent | 9335d300dbf62e7b8bd140f6388358fe71a62bc0 (diff) | |
download | clogger-3547efe6386bb4ad224be49b723d16cde2067f9c.tar.gz |
It's expensive to create if not needed, and no current released version of Rack has my proposed optimizations for it yet...
Diffstat (limited to 'lib/clogger/pure.rb')
-rw-r--r-- | lib/clogger/pure.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/clogger/pure.rb b/lib/clogger/pure.rb index 718db9a..2800802 100644 --- a/lib/clogger/pure.rb +++ b/lib/clogger/pure.rb @@ -14,6 +14,7 @@ class Clogger @fmt_ops = compile_format(opts[:format] || Format::Common, opts) @wrap_body = need_wrap_body?(@fmt_ops) @reentrant = nil + @need_resp = need_response_headers?(@fmt_ops) @body_bytes_sent = 0 end @@ -25,7 +26,7 @@ class Clogger raise TypeError, "app response not a 3 element Array: #{resp.inspect}" end status, headers, body = resp - headers = Rack::Utils::HeaderHash.new(headers) + headers = Rack::Utils::HeaderHash.new(headers) if @need_resp if wrap_body? @reentrant = env['rack.multithread'] @env, @status, @headers, @body = env, status, headers, body |