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

Kinkie gkinkie at gmail.com
Thu Jul 23 16:45:27 UTC 2015


On Thu, Jul 23, 2015 at 3:55 PM, Alex Rousskov <
rousskov at measurement-factory.com> wrote:

> On 07/23/2015 01:46 AM, Kinkie wrote:
>
> > the only thing I don't understand is the XXX in
> > parsedSize(); it's not clear why the comment,
>
> The parsedSize() method is broken: It claims to return the number of
> bytes parsed, but it does not return that. It usually returns the number
> of bytes parsed from the left, but not from the right of the string. For
> example,
>
>   skipOne()
>   skipOneTrailing()
>
> should usually result in parsedSize() returning 2 because 2 bytes were
> parsed and removed from the string. It usually returns 1.
>
>
> > and what to use instead.
>
> There is currently no good alternative. Discussing the best way forward
> is outside this project scope (but I welcome such a separate discussion,
> of course). Fortunately, no existing code misuses parsedSize() today AFAIK.
>
>
> > as soon as that's improved, +1.
>
> Why?! This is not something the patch breaks. Do you want me to remove
> the XXX and just pretend that we have not discovered the problem?
>

Amos has brought some objections to the proposal, I'll try to clarify what
I meant:
because the comment is issuing guidance to callers of that API: as
proposed, the guidance is incomplete both for any callers trying to
understand what API to use.
If anything, there should be a BUG mark so that implementors may fix it.


> Hope this clarifies,


Same here :)

 Kinkie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150723/54aa24a1/attachment.html>


More information about the squid-dev mailing list