Browse Source

* tune log messages

master
Alex 'AdUser' Z 8 years ago
parent
commit
fedaeb5bc8
  1. 6
      src/jail.c
  2. 2
      src/sources/files.c

6
src/jail.c

@ -253,7 +253,7 @@ f2b_jail_process(f2b_jail_t *jail) {
if (!addr) { if (!addr) {
addr = f2b_ipaddr_create(matchbuf, jail->maxretry); addr = f2b_ipaddr_create(matchbuf, jail->maxretry);
jail->ipaddrs = f2b_addrlist_append(jail->ipaddrs, addr); jail->ipaddrs = f2b_addrlist_append(jail->ipaddrs, addr);
f2b_log_msg(log_debug, "jail '%s': new ip found -- %s", jail->name, matchbuf); f2b_log_msg(log_debug, "jail '%s': found new ip %s", jail->name, matchbuf);
} }
addr->lastseen = now; addr->lastseen = now;
if (addr->banned) { if (addr->banned) {
@ -271,7 +271,7 @@ f2b_jail_process(f2b_jail_t *jail) {
f2b_matches_expire(&addr->matches, findtime); f2b_matches_expire(&addr->matches, findtime);
f2b_matches_append(&addr->matches, now); f2b_matches_append(&addr->matches, now);
if (addr->matches.used < jail->maxretry) { if (addr->matches.used < jail->maxretry) {
f2b_log_msg(log_info, "jail '%s': new ip match -- %s (%zu/%zu)", f2b_log_msg(log_info, "jail '%s': new match for ip %s (%zu/%zu)",
jail->name, matchbuf, addr->matches.used, addr->matches.max); jail->name, matchbuf, addr->matches.used, addr->matches.max);
continue; continue;
} }
@ -292,7 +292,7 @@ f2b_jail_process(f2b_jail_t *jail) {
: addr->release_at; : addr->release_at;
expiretime += jail->expiretime; expiretime += jail->expiretime;
if (now > expiretime) { if (now > expiretime) {
f2b_log_msg(log_info, "jail '%s': expired ip -- %s", f2b_log_msg(log_info, "jail '%s': expired ip %s",
jail->name, addr->text); jail->name, addr->text);
remove = true; remove = true;
} }

2
src/sources/files.c

@ -221,7 +221,7 @@ next(cfg_t *cfg, char *buf, size_t bufsize, bool reset) {
file_close(file); file_close(file);
if (!file->opened && !file_open(file, NULL)) { if (!file->opened && !file_open(file, NULL)) {
if (cfg->errcb) { if (cfg->errcb) {
snprintf(cfg->error, sizeof(cfg->error), "can't open file -- %s", file->path); snprintf(cfg->error, sizeof(cfg->error), "can't open file: %s", file->path);
cfg->errcb(cfg->error); cfg->errcb(cfg->error);
} }
continue; continue;

Loading…
Cancel
Save