Reinit logs for a given connection on well chosen times.
This commit is contained in:
parent
a00a146193
commit
e9e9549228
10
src/bip.c
10
src/bip.c
@ -350,6 +350,7 @@ static int add_connection(bip_t *bip, struct user *user, list_t *data)
|
||||
} else {
|
||||
#warning "CODEME (user switch..)"
|
||||
l->network = NULL;
|
||||
log_reinit_all(l->log);
|
||||
}
|
||||
|
||||
while ((t = list_remove_first(data))) {
|
||||
@ -1020,14 +1021,7 @@ void adm_reply(struct link_client *ic, char *str)
|
||||
extern struct link_client *reloading_client;
|
||||
void adm_blreset(struct link_client *ic)
|
||||
{
|
||||
hash_iterator_t it;
|
||||
for (hash_it_init(&LINK(ic)->log->logfgs, &it);
|
||||
hash_it_item(&it);
|
||||
hash_it_next(&it)) {
|
||||
logfilegroup_t *lfg = hash_it_item(&it);
|
||||
log_reset(lfg);
|
||||
}
|
||||
|
||||
log_reinit_all(LINK(ic)->log);
|
||||
adm_reply(ic, "Resetted.");
|
||||
}
|
||||
|
||||
|
18
src/log.c
18
src/log.c
@ -603,17 +603,11 @@ void log_client_disconnected(log_t *logdata)
|
||||
mylog(LOG_DEBUG, "A client disconnected");
|
||||
}
|
||||
|
||||
void log_client_none_connected(log_t *logdata)
|
||||
void log_reinit_all(log_t *logdata)
|
||||
{
|
||||
logfilegroup_t *lfg;
|
||||
hash_iterator_t hi;
|
||||
|
||||
logdata->connected = 0;
|
||||
|
||||
if (logdata->user->always_backlog)
|
||||
return;
|
||||
|
||||
|
||||
for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi);
|
||||
hash_it_next(&hi)) {
|
||||
lfg = hash_it_item(&hi);
|
||||
@ -621,6 +615,16 @@ void log_client_none_connected(log_t *logdata)
|
||||
}
|
||||
}
|
||||
|
||||
void log_client_none_connected(log_t *logdata)
|
||||
{
|
||||
logdata->connected = 0;
|
||||
|
||||
if (logdata->user->always_backlog)
|
||||
return;
|
||||
|
||||
log_reinit_all(logdata);
|
||||
}
|
||||
|
||||
void log_client_connected(log_t *logdata)
|
||||
{
|
||||
mylog(LOG_DEBUG, "A client connected");
|
||||
|
Loading…
x
Reference in New Issue
Block a user