On 05/24/2013 03:13 AM, Amos Jeffries wrote: > On 24/05/2013 11:51 a.m., quickdry21 wrote: >> I was wondering if it would be possible to include an a HTTP response >> status line tag to the external_acl_type, or even possibly the HTTP-Version, >> Status-Code and Reason-Phrase as three separate format tags. >> >> The reason I ask is I'm trying to hook some of my code that needs the >> status code from the response into an external_acl_type call. This doesn't >> really seem like the purpose of the external_acl_type, but I'm hoping it will >> suit my purpose. It doesn't seem like an unreasonable thing to be able do, >> considering you can already pass response headers as format tags. >> >> If this is possible to do, I'm willing to write the additional code >> myself if someone could point me in the right direction.
> Should be possible. Patches welcome. Eric, If you work on this, please use a dedicated tag for each component (HTTP-Version, Status-Code, and Reason-Phrase) instead of one tag for the entire response status line. Also, I recommend ignoring Reason-Phrase because it is normally of no use, it requires escaping/quoting to protect whitespace, and Squid does not even preserve it when forwarding messages. > FYI: I am working on converting all these format codes to using the > logformat code system. So if your patch could use the token name "%<Hs" > there will not be any re-config needed when that change happens in the > not too distant future. I second that recommendation. Use existing logformat "tag" (we usually call them codes) whenever possible. It should be possible in your cases, unless you insist on passing Reason-Phrase. As a starting point, just grep Squid code for other external ACL tags to find places where they are processed. Thank you, Alex.