summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-03-17 03:37:52 +0000
committerNick Mathewson <nickm@torproject.org>2008-03-17 03:37:52 +0000
commitbd547e3cfc5608cbab9c571a5d05d7de838dba77 (patch)
tree48a24f83440036f865b7f0682bebbd9ce5251429
parent23c355e4eab5765c697447bc9efdbe99110fab5b (diff)
downloadtor-bd547e3cfc5608cbab9c571a5d05d7de838dba77.tar.gz
tor-bd547e3cfc5608cbab9c571a5d05d7de838dba77.zip
r18861@catbus: nickm | 2008-03-16 23:22:56 -0400
Fix a couple of bugs in setting control log callback severity. svn:r14065
-rw-r--r--src/common/log.c4
-rw-r--r--src/or/control.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 8f55694ace..0aa78e4e28 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -571,10 +571,12 @@ change_callback_log_severity(int loglevelMin, int loglevelMax,
log_callback cb)
{
logfile_t *lf;
+ log_severity_list_t severities;
+ set_log_severity_config(loglevelMin, loglevelMax, &severities);
LOCK_LOGS();
for (lf = logfiles; lf; lf = lf->next) {
if (lf->callback == cb) {
- set_log_severity_config(loglevelMin, loglevelMax, lf->severities);
+ memcpy(lf->severities, &severities, sizeof(severities));
}
}
_log_global_min_severity = get_min_log_level();
diff --git a/src/or/control.c b/src/or/control.c
index a8fd46de07..01d5918112 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -248,9 +248,13 @@ control_adjust_event_log_severity(void)
if (max_log_event < EVENT_ERR_MSG)
max_log_event = EVENT_ERR_MSG;
}
- change_callback_log_severity(event_to_log_severity(min_log_event),
- event_to_log_severity(max_log_event),
- control_event_logmsg);
+ if (min_log_event <= max_log_event)
+ change_callback_log_severity(event_to_log_severity(min_log_event),
+ event_to_log_severity(max_log_event),
+ control_event_logmsg);
+ else
+ change_callback_log_severity(LOG_ERR, LOG_ERR,
+ control_event_logmsg);
}
/** Return true iff the event with code <b>c</b> is being sent to any current