avoid reusing env on hijack
commit30e3c6abe542c6a9f5955e1d65896a0c3bab534f
authorEric Wong <ew@80x24.org>
Sat, 16 Dec 2017 01:22:40 +0000 (16 01:22 +0000)
committerEric Wong <e@80x24.org>
Sat, 16 Dec 2017 01:33:46 +0000 (16 01:33 +0000)
tree5cecdf58f29e130c423e7bf7b671800f56143eec
parent1a407d78c90695c03ec6ac1e0a8b7f0e466c975e
avoid reusing env on hijack

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>
ext/unicorn_http/unicorn_http.rl
lib/unicorn/http_request.rb
lib/unicorn/http_response.rb
lib/unicorn/http_server.rb
t/hijack.ru
t/t0200-rack-hijack.sh