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

Re: [Libevent-users] Send evbuffer to multiple clients

2011-06-06 Thread Nick Mathewson
On Wed, Jun 1, 2011 at 11:28 AM, Joachim Bauch wrote: > Hi, > > what is the best way to pass data from one evbuffer to multiple > clients (i.e. other evbuffers)? There seems to be no direct way as > the obvious "evbuffer_add_buffer" removes data from the source buffer. > > For now I use a combinat

[Libevent-users] Dead or wrong code

2011-06-06 Thread Gilad Benjamini
evbuffer_drain has the code below. Can chain ever be NULL in line 956 ? If the while was completed due to the test in line 935, which dereferenced chain, it can't. If the while was broken in line 950, then line 949 dereferenced chain, so it can't be NULL either. I.e. either the test in line 956

[Libevent-users] Missing error checking

2011-06-06 Thread Gilad Benjamini
Hi, Here are a few cases where error checking is missing. Not knowing the code, I can mostly just point to the issues without suggesting fixes. - evthread_set_condition_callbacks - The first half of the function assumes cbs might be NULL. The second half references cbs without validation - evbuf