[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte
On Mon, Jun 13, 2011 at 8:10 PM, Nir Soffer <nirsof@xxxxxxxxx> wrote:
>
> On Jun 14, 2011, at 12:06 AM, Nick Mathewson wrote:
>> If you like my tweaks, I think this is a branch ready to merge onto 2.1.
>
> I think they are good.
>
> Why 2.1 and not next bug fix release for 2.0?
I guess it depends whether we decide to call this a bugfix or a new
feature. Bugfixes can go in stable releases; new features can't.
Since the point of this patch series is to assign a consistent
interpretation to previously undefined set of arguments, it looks like
a new feature to me.
> In
> https://github.com/nmathewson/Libevent/commit/9ab8ab83cd87d3733674e8b483d823eab3ff531b
> You set the value of _internal.pos_in_chain when returning the "not found"
> pointer. There are other places that do not set it. The attached patch set
> all the fields when not found pointer is returned.
Looks good.
> Now, I wonder if we can unify the "not found" and "end of buffer" pointers -
> what if both set .pos to -1?
I don't think that's a good interface; "pos" for the "end of buffer"
pointer should honestly be equal to the buffer length. The index of
"nowhere" in a 16-byte buffer might be -1 by convention, but the index
of the position after the last character in a 16-byte buffer is
naturally 16, not -1.
yrs,
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.