[Libevent-users] event_base_loop_break()?

2007-09-18 Thread Scott Lamb
While playing with pyevent, I saw this code: def abort(): """Abort event dispatch loop.""" cdef extern int event_gotsig cdef extern int (*event_sigcb)() event_sigcb = __event_sigcb event_gotsig = 1 This is used in exception handling - if a callback throws an exception, it do

Re: [Libevent-users] event_add() failure return handling

2007-09-18 Thread M.H.VanLeeuwen
Christopher Layne wrote: On Tue, Sep 18, 2007 at 10:10:42PM -0500, M.H.VanLeeuwen wrote: Hi, When event_add(&ev, &tv) returns -1, what is the proper way to clean up. For example function XYZZY() takes socket fd as an argument XYZZY(int sockfd) { allocate event structure related memory... .

Re: [Libevent-users] event_add() failure return handling

2007-09-18 Thread Christopher Layne
On Tue, Sep 18, 2007 at 10:10:42PM -0500, M.H.VanLeeuwen wrote: > Hi, > > When event_add(&ev, &tv) returns -1, what is the proper way to clean up. > > For example function XYZZY() takes socket fd as an argument > > XYZZY(int sockfd) > { > allocate event structure related memory... > ... >

[Libevent-users] event_add() failure return handling

2007-09-18 Thread M.H.VanLeeuwen
Hi, When event_add(&ev, &tv) returns -1, what is the proper way to clean up. For example function XYZZY() takes socket fd as an argument XYZZY(int sockfd) { allocate event structure related memory... ... event_set(&(event->event), sockfd, EV_TIMEOUT | EV_WRITE | EV_PERSIST, connected, &(

[Libevent-users] [PATCH] test/Makefile.am: Correct a relative path issue

2007-09-18 Thread Christopher Layne
1. event_rpcgen.py will fail to open regress.rpc if building outside the source directory. -cl -- Index: Makefile.am === --- Makefile.am (revision 433) +++ Makefile.am (working copy) @@ -18,7 +18,7 @@ bench_SOURCES = bench.c reg

[Libevent-users] [PATCH] Alter output of test/bench and add option flags

2007-09-18 Thread Christopher Layne
1. Change output to provide a single line pct done + avg/min/max. 2. Add "-l" flag to support previous style. 3. Add "-x n" flag to specify max loop iterations. In a nutshell, output looks like this: $ debug/test/bench -x 8192 done avg min max 17% 942