diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-11-19 22:22:43 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-11-19 22:22:43 -0500 |
commit | 6199ac5fbec7f8a862440a8b65f7f299de4c2dbf (patch) | |
tree | 4bbb1629fde78b71981ec4205e65927023b3efea /src/common/compat_libevent.c | |
parent | a33b338c5bf5e40037f465c0257a70dedb095e82 (diff) | |
download | tor-6199ac5fbec7f8a862440a8b65f7f299de4c2dbf.tar.gz tor-6199ac5fbec7f8a862440a8b65f7f299de4c2dbf.zip |
Do not send Libevent log messages to a controller.
Doing so could make Libevent call Libevent from inside a Libevent
logging call, which is a recipe for reentrant confusion and
hard-to-debug crashes. This would especially hurt if Libevent
debug-level logging is enabled AND the user has a controller
watching for low-severity log messages.
Fix bug 2190; fix on 0.1.0.2-rc.
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r-- | src/common/compat_libevent.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index 250fa2bdb7..96843c73e4 100644 --- a/src/common/compat_libevent.c +++ b/src/common/compat_libevent.c @@ -65,19 +65,19 @@ libevent_logging_callback(int severity, const char *msg) } switch (severity) { case _EVENT_LOG_DEBUG: - log(LOG_DEBUG, LD_NET, "Message from libevent: %s", buf); + log(LOG_DEBUG, LD_NOCB|LD_NET, "Message from libevent: %s", buf); break; case _EVENT_LOG_MSG: - log(LOG_INFO, LD_NET, "Message from libevent: %s", buf); + log(LOG_INFO, LD_NOCB|LD_NET, "Message from libevent: %s", buf); break; case _EVENT_LOG_WARN: - log(LOG_WARN, LD_GENERAL, "Warning from libevent: %s", buf); + log(LOG_WARN, LD_NOCB|LD_GENERAL, "Warning from libevent: %s", buf); break; case _EVENT_LOG_ERR: - log(LOG_ERR, LD_GENERAL, "Error from libevent: %s", buf); + log(LOG_ERR, LD_NOCB|LD_GENERAL, "Error from libevent: %s", buf); break; default: - log(LOG_WARN, LD_GENERAL, "Message [%d] from libevent: %s", + log(LOG_WARN, LD_NOCB|LD_GENERAL, "Message [%d] from libevent: %s", severity, buf); break; } |