[squid-dev] [PATCH] suffix parsing and skipping

Amos Jeffries squid3 at treenet.co.nz
Fri Jul 24 11:36:09 UTC 2015


On 24/07/2015 4:41 p.m., Alex Rousskov wrote:
> On 07/23/2015 11:11 AM, Amos Jeffries wrote:
> 
>> Particular since the full fix is a one-liner in consumeTrailing() in
>> place of that comment, and currently affecting no other code that would
>> need auditing.
>> That one-liner being identical to the matching code in consume():
>>     parsed_ += result.length();
> 
> I doubt this is the right fix because some of the callers that will use
> parsedSize() may only care about the consumed prefix bytes. However, I
> will include this fix in the patch to avoid further discussion.
> 

I think it is. For several reason which we can now ignore;

* The member and method are documented as just "parsed size". No
specific direction implied.

* the callers making use of parsedSize() today are exclusively using
forward-Tokenizers. So the broken behaviour on suffix is not affecting
them either way.

* if we ever get a mixed-direction Tokenizer that caller will need to
cope and it seem better that the behaviour be consistent for each
direction, right now its all over the place for suffix handling
(sometimes accounted, sometimes not).

* the exclusively reverse-Tokenizers might one day want to use
parsedSize() for something, but can't in its current state. For example
perhapse using parsedSize() to account how many garbage delimiters have
been pruned off the found line between Http-Version and URI. This
matters when traffic counting read I/O bytes vs size of the message SBuf
Parser outputs.

Amos



More information about the squid-dev mailing list