On 08/24/2016 08:30 AM, Amos Jeffries wrote: > On 25/08/2016 12:36 a.m., Eduard Bagdasaryan wrote: >> 2016-08-23 18:01 GMT+03:00 Alex Rousskov: >> >>> invalid request-line: missing delimiter before "HTTP/1" >> >> In order to generate "where" with such detalization (i.e. the specific >> protocol version or method) we would need to pass skipDelimiter() the >> parsed AnyP::ProtocolVersion or HttpRequestMethod objects, which would >> require converting skipDelimiter() to a template: >> >> <template class C> skipDelimiter(size_t, const char *where, const C >> &what); > > Two options there; > > Option 1, is to use a fixed and slightly generic where message: > "before protocol version" > > Pros: static debugs message, only used when actually needed. > > Cons: its generic rather than protocol specific. > > > Option 2, is to use a PackableStream to construct that part of debug > message in advance. > > Pros: its accurate and detailed > > Cons: extra memory and time required to generate the string when its > probably never used.
> I think go with option 1 since this is a performance critical piece of code. I agree but for a completely different reason: * Effective error triage needs a lot more details than a specific method name or protocol version -- a different problem we are not trying to solve here. * I do not consider error handling to be a performance critical piece of code (and yes, we have already discussed whether error handling is performance-critical, and we disagree on that). Cheers, Alex. _______________________________________________ squid-dev mailing list squid-dev@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-dev