diff options
author | Martin Willi <martin@strongswan.org> | 2007-02-28 14:04:36 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-02-28 14:04:36 +0000 |
commit | c60c7694d2d8925c5d93ff33d132f561ad89e071 (patch) | |
tree | 9c7957b0749139c5e7c9b008c927e79d69f8e500 /src/charon/bus/bus.c | |
parent | a7a5e834e318d0582b6db979b63a5739c0a8244f (diff) | |
download | strongswan-c60c7694d2d8925c5d93ff33d132f561ad89e071.tar.bz2 strongswan-c60c7694d2d8925c5d93ff33d132f561ad89e071.tar.xz |
merged tasking branch into trunk
Diffstat (limited to 'src/charon/bus/bus.c')
-rw-r--r-- | src/charon/bus/bus.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/charon/bus/bus.c b/src/charon/bus/bus.c index afed16656..740663d5c 100644 --- a/src/charon/bus/bus.c +++ b/src/charon/bus/bus.c @@ -180,7 +180,7 @@ static int get_thread_number(private_bus_t *this) static void add_listener(private_bus_t *this, bus_listener_t *listener) { pthread_mutex_lock(&this->mutex); - this->listeners->insert_last(this->listeners, (void*)listener); + this->listeners->insert_last(this->listeners, listener); pthread_mutex_unlock(&this->mutex); } @@ -301,7 +301,12 @@ static void vsignal(private_bus_t *this, signal_t signal, level_t level, va_list args_copy; va_copy(args_copy, args); - listener->signal(listener, signal, level, thread, ike_sa, format, args_copy); + if (!listener->signal(listener, signal, level, thread, + ike_sa, format, args_copy)) + { + /* unregister listener if requested */ + iterator->remove(iterator); + } va_end(args_copy); } iterator->destroy(iterator); |