Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-20 Thread Nick Mathewson
On Mon, Jun 13, 2011 at 8:10 PM, Nir Soffer 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

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-13 Thread Nir Soffer
On Jun 14, 2011, at 12:06 AM, Nick Mathewson wrote: On Wed, Jun 8, 2011 at 8:38 PM, Nir Soffer wrote: [...] Also, there's another problem with my original patch. By my logic, if the buffer is empty and has no chains at all, then evbuffer_ptr_set(buf, ptr, 0, EVBUFFER_PTR_SET) ought to work

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-13 Thread Nick Mathewson
On Wed, Jun 8, 2011 at 8:38 PM, Nir Soffer wrote: [...] >> Also, there's another problem with my original patch.  By my logic, if >> the buffer is empty and has no chains at all, then >> evbuffer_ptr_set(buf, ptr, 0, EVBUFFER_PTR_SET) ought to work, but >> even with my patch it still doesn't.  Mo

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-09 Thread Nir Soffer
On Jun 9, 2011, at 3:38 AM, Nir Soffer wrote: I think I have a working patch. <0003-Allow-searching-up-to-the-end-of-the-buffer.patch> This patch fixes a race condition when checking for the special "end of buffer" ptr. 0004-Fix-race-codition-when-checking-for-the-special-end-.patch De

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-08 Thread Nir Soffer
On Jun 8, 2011, at 8:50 PM, Nick Mathewson wrote: On Tue, Jun 7, 2011 at 9:30 AM, Nir Soffer wrote: On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: Here's another patch that might make stuff work. Before I'd apply it, I'd like to hav

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-08 Thread Nick Mathewson
On Tue, Jun 7, 2011 at 9:30 AM, Nir Soffer wrote: > > On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: > >> On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: >> Here's another patch that might make stuff work.  Before I'd apply it, >> I'd like to have a look through everything that's using >> ev

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-07 Thread Nir Soffer
On Jun 7, 2011, at 5:01 PM, Andrew W. Nosenko wrote: On Tue, Jun 7, 2011 at 16:30, Nir Soffer wrote: On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: Here's another patch that might make stuff work. Before I'd apply it, I'd like to ha

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-07 Thread Nir Soffer
On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: Here's another patch that might make stuff work. Before I'd apply it, I'd like to have a look through everything that's using evbuffer_ptr_set() and evbuffer_ptr right now to make sure that not

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-07 Thread Andrew W. Nosenko
On Tue, Jun 7, 2011 at 16:30, Nir Soffer wrote: > > On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: > >> On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: >> Here's another patch that might make stuff work.  Before I'd apply it, >> I'd like to have a look through everything that's using >> evbu

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-07 Thread Nir Soffer
On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: Here's another patch that might make stuff work. Before I'd apply it, I'd like to have a look through everything that's using evbuffer_ptr_set() and evbuffer_ptr right now to make sure that not

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-07 Thread Nir Soffer
On Jun 7, 2011, at 4:03 AM, Nick Mathewson wrote: On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: Hi, I found that evbuffer_search_range fails when you try search the last byte with a non null end pointer. You can work around this by checking the buffer length and calling evbuffer_sear

Re: [Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-06 Thread Nick Mathewson
On Mon, Jun 6, 2011 at 8:37 PM, Nir Soffer wrote: > Hi, > > I found that evbuffer_search_range fails when you try search the last byte > with a non null end pointer. > > You can work around this by checking the buffer length and calling > evbuffer_search() instead, or evbuffer_search_range with a

[Libevent-users] [PATCH] evbuffer_search_range fails when searching the last byte

2011-06-06 Thread Nir Soffer
Hi, I found that evbuffer_search_range fails when you try search the last byte with a non null end pointer. You can work around this by checking the buffer length and calling evbuffer_search() instead, or evbuffer_search_range with a null end pointer. I don't know how to fix it yet, but