<div>Hi Igor</div><div><br></div><div>Really thankful for your patience with me. I think I now understood what you are saying :).</div><div><br></div><div>To summarize, header.hash == 0 is used as a flag in ngx_http_header_filter_module.c:http_header_filter to test whether to send the header downstream or not. Setting it to 1(or anything non-zero) is to ensure that the header is sent downstream.</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>Since headers_out is not used by nginx core to do hash lookups, it doesnt calculate hash or lowcase_key, however modules like proxy or fastcgi use the hash value for their own benefit in which case they ensure that the hash/lowcase_key is initialized.</div>
<div><br></div><div>I hope I got it right this time.</div><div><br></div><div>Thanks again for your time and patience.</div><div><br></div><div>+Fasih</div><br><div class="gmail_quote">On Thu, Nov 24, 2011 at 12:20 AM, Igor Sysoev <span dir="ltr"><<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Wed, Nov 23, 2011 at 10:58:41PM +0530, Fasih wrote:<br>
> On Wed, Nov 23, 2011 at 10:38 PM, Igor Sysoev <<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>> wrote:<br>
><br>
> > On Wed, Nov 23, 2011 at 10:32:27PM +0530, Fasihullah Askiri wrote:<br>
> > > Sorry, I am not sure I understood you correctly. It is used in headers_in<br>
> > > for look up into headers_in_hash OK. But what about headers_out?<br>
> ><br>
> > "lowcase_key" in headers_out may be not set if these headers are not<br>
> > proxied/fastcgied/etc.<br>
> ><br>
> > > ngx_http_proxy_process_header parses the upstream response headers<br>
> > > using ngx_http_parse_header_line, thereby setting hash/lowcase_key. This<br>
> > > function sets headers_out which I use. The question I have is, is it safe<br>
> > > to use the headers_out.....lowcase_key, should I check for<br>
> > > headers_out.headers.part.elt[it].hash before I can use lowcase_key or<br>
> > > should I check for something else?<br>
> ><br>
> > "hash" does not mean that "lowcase_key" is set.<br>
> > If nginx needs to find headers using hash, it sets "lowcase_key" and<br>
> > calculates "hash".<br>
> ><br>
> So, if header "xyz-header" is not expected to be found in a hash, nginx<br>
> would not calculate the lowcase_key, but will it also set<br>
> headers_out.header.elt.hash to some value to signal that it has not<br>
> calculated the lowcase_key?<br>
<br>
</div>No, "hash" is not a flag for "lowcase_key".<br>
<br>
"hash" is used as a hash value of "lowcase_key" for lookup in header hashes.<br>
And "hash" is used as flag only for header output filter.<br>
<div class="im"><br>
> > Besides nginx uses "hash" only in header output filter.<br>
> ><br>
> Understood, but the problem is because I am trying to reuse that variable<br>
> probably for something that it was intended to be used, just wanted to find<br>
> out how to use it if at all I can use it.<br>
<br>
</div>nginx does not calculate "hash" and does not provide "lowcase_key" for<br>
headers_out, since it does not use it.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
Igor Sysoev<br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</div></div></blockquote></div><br>