HN2new | past | comments | ask | show | jobs | submitlogin

I may be missing something here. I do see that the patch[1] now creates a new request object, and thus a new "env" Ruby hash for each request.

But I don't see the old behavior described as "allocates one single Ruby Hash that is then cleared (using Hash#clear) between each request"...even after poking around in http_request.rb and other places. I reads like the pre-patched version would just re-use the hash as-is, only overwriting/adding if it saw a new key or value, but not deleting any keys.

[1] https://yhbt.net/unicorn-public/66A68DD8-83EF-4C7A-80E8-3F1F...



Maybe here? https://github.com/defunkt/unicorn/blob/2c347116305338710331...

Admittedly, that's an older copy, I'd have to look up a newer copy of the source to see if that function or a similar one still exists.

The change was made in Unicorn v6 according to https://yhbt.net/unicorn/NEWS.html so I'd have to find code earlier than that, maybe.

https://yhbt.net/unicorn.git/tree/ext/unicorn_http/unicorn_h... looks like it's still there.

If I'm reading this right, the init function in the above unicorn_http.rl function is what's referred to as HttpRequest#new thanks to https://yhbt.net/unicorn.git/tree/lib/unicorn/http_request.r... but I might be misreading this.

Actually... compared to uWSGI's source code, this is quite pleasant to read, warts and all. :D


Ahh, yep. I hadn't thought to look at Ragel source.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: