Re: env reuse and hijack

2017-12-04 Thread Eric Wong
Eric Wong  wrote:
> Totally untested; but maybe the patch below works for you
> by replacing the buf and env objects in the hijacked cases.
> 
> Can you try it and report back?  Thanks.

Btw, did you get a chance to look at my patch? (I haven't :x)
--
unsubscribe: unicorn-public+unsubscr...@bogomips.org
archive: https://bogomips.org/unicorn-public/



env reuse and hijack

2017-11-28 Thread Sam Saffron
I was reading through unicorn today and noticed that it uses
`HttpParser_clear` to clear up env between requests as opposed to
allocating a new `env` object.

This is generally fine, but if you hijack a request you may want to
still look at env after this is done leading to situations where you
are looking at the wrong env by the time you are dealing with the
hijacked request

I guess I have 2 questions

1. Should Rack specify that env must be "re-initialized" if for any
reason a request is hijacked?

2. Should unicorn allow you to opt for env "recycle" via a rack key?

I don't really have the answers here, my simplest course of action is
simple to clone all the key/value pairs in env on to a new hash when I
hijack, but it feels wasteful.