aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-02-13 17:38:49 +0100
committerTobias Brunner <tobias@strongswan.org>2017-02-16 19:24:09 +0100
commit8bd8dcd52264fb7f3611dd254090491dc9f94a2d (patch)
treefe831e919da1c9a2f9dba32629f6a3ad67889b80 /src/libcharon
parentfa5f6ba26c0be128f9220ccd6409309c85188456 (diff)
downloadstrongswan-8bd8dcd52264fb7f3611dd254090491dc9f94a2d.tar.bz2
strongswan-8bd8dcd52264fb7f3611dd254090491dc9f94a2d.tar.xz
vici: Only log messages if there actually is a listener
Diffstat (limited to 'src/libcharon')
-rw-r--r--src/libcharon/plugins/vici/vici_logger.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcharon/plugins/vici/vici_logger.c b/src/libcharon/plugins/vici/vici_logger.c
index 6d3584ebd..8e7bcfa1c 100644
--- a/src/libcharon/plugins/vici/vici_logger.c
+++ b/src/libcharon/plugins/vici/vici_logger.c
@@ -95,6 +95,11 @@ METHOD(logger_t, log_, void,
private_vici_logger_t *this, debug_t group, level_t level, int thread,
ike_sa_t* ike_sa, const char *msg)
{
+ if (!this->dispatcher->has_event_listeners(this->dispatcher, "log"))
+ {
+ return;
+ }
+
this->mutex->lock(this->mutex);
/* avoid recursive invocations by the vici subsystem */
@@ -130,6 +135,8 @@ METHOD(logger_t, log_, void,
METHOD(logger_t, get_level, level_t,
private_vici_logger_t *this, debug_t group)
{
+ /* anything higher might produce a loop as sending messages or listening
+ * for clients might cause log messages itself */
return LEVEL_CTRL;
}