diff options
author | Eric Wong <ew@80x24.org> | 2017-12-16 01:22:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-12-16 01:33:46 +0000 |
commit | 30e3c6abe542c6a9f5955e1d65896a0c3bab534f (patch) | |
tree | 5cecdf58f29e130c423e7bf7b671800f56143eec /lib/unicorn/http_server.rb | |
parent | 1a407d78c90695c03ec6ac1e0a8b7f0e466c975e (diff) | |
download | unicorn-30e3c6abe542c6a9f5955e1d65896a0c3bab534f.tar.gz |
Hijackers may capture and reuse `env' indefinitely, so we must not use it in those cases for future requests. For non-hijack requests, we continue to reuse the `env' object to reduce memory recycling. Reported-and-tested-by: Sam Saffron <sam.saffron@gmail.com>
Diffstat (limited to 'lib/unicorn/http_server.rb')
-rw-r--r-- | lib/unicorn/http_server.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index f33aa25..8674729 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -614,8 +614,7 @@ class Unicorn::HttpServer return if @request.hijacked? end @request.headers? or headers = nil - http_response_write(client, status, headers, body, - @request.response_start_sent) + http_response_write(client, status, headers, body, @request) ensure body.respond_to?(:close) and body.close end |