From 4f4997551d7e0b500553d673074f61a965d43742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Fri, 8 Jan 2021 05:32:48 -0600 Subject: [PATCH] ITS#8747 Avoid epoch recursion in connection_write_cb --- servers/lloadd/connection.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/lloadd/connection.c b/servers/lloadd/connection.c index d5898ddb58..fd1527f3e3 100644 --- a/servers/lloadd/connection.c +++ b/servers/lloadd/connection.c @@ -322,7 +322,10 @@ connection_write_cb( evutil_socket_t s, short what, void *arg ) return; } - epoch = epoch_join(); + /* If what == 0, we have a caller as opposed to being a callback */ + if ( what ) { + epoch = epoch_join(); + } checked_lock( &c->c_io_mutex ); Debug( LDAP_DEBUG_CONNS, "connection_write_cb: " @@ -369,7 +372,9 @@ connection_write_cb( evutil_socket_t s, short what, void *arg ) done: RELEASE_REF( c, c_refcnt, c->c_destroy ); - epoch_leave( epoch ); + if ( what ) { + epoch_leave( epoch ); + } } void