Custom response codes and content-types for memcache module
mdounin at mdounin.ru
Fri Aug 22 00:46:40 MSD 2008
On Thu, Aug 14, 2008 at 05:10:32PM +0200, Spil Games wrote:
>Spil Games wrote:
>> I don't fully understand what's going on with the
>> 'upstream.pass_request_headers' in the fastcgi and proxy modules, but
>> ofcourse it would be a better approach to reuse than to reinvent. I will
>> have a look and see if I can do that.
>I have done my best (see attached patch), but somehow Nginx doesn't like
>the 'ngx_list_push(&u->headers_in.headers)' code I copied from the
>fastcgi module. The code in question is commented out in the attached
>patch, so it just skips over the headers. Whenever enabled, debug output
>shows that headers are parsed correctly, but Nginx crashes with a SIGFPE
>after returning an NGX_OK from the process_header handler.
>I have no idea what is going on and have spent hours looking over the
>code of both the fastcgi and proxy modules. Could you have a look to see
>what I'm doing wrong? I am about to pull my hair. ;-)
The problem is that nginx isn't prepared to work with headers
without properly initialized upstream.hide_headers hash. Since
memcached module doesn't return headers - it doesn't bother with
initializing the hash. With initialization added (see
fastcgi/proxy modules for examples) your patch works as expected.
I haven't tested it much though.
More information about the nginx