mirror of
https://github.com/bol-van/zapret.git
synced 2026-10-25 20:36:49 +09:00
recheck domain before adding to autohostlist
This commit is contained in:
1 parent
d0ce7846c4
commit
7ef7cbe554
24 files changed
+36
-16
No files matched your search
+17
-8
@@ -225,16 +225,25 @@ static void auto_hostlist_failed(const char *hostname)
|
||||
{
|
||||
DLOG("auto hostlist : fail threshold reached. adding %s to auto hostlist\n", hostname);
|
||||
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
||||
if (!StrPoolAddStr(¶ms.hostlist, hostname))
|
||||
|
||||
DLOG("auto hostlist : rechecking %s to avoid duplicates\n", hostname);
|
||||
bool bExcluded=false;
|
||||
if (!HostlistCheck(params.hostlist, params.hostlist_exclude, hostname, &bExcluded) && !bExcluded)
|
||||
{
|
||||
fprintf(stderr, "StrPoolAddStr out of memory\n");
|
||||
return;
|
||||
}
|
||||
if (!append_to_list_file(params.hostlist_auto_filename, hostname))
|
||||
{
|
||||
perror("write to auto hostlist:");
|
||||
return;
|
||||
DLOG("auto hostlist : adding %s\n", hostname);
|
||||
if (!StrPoolAddStr(¶ms.hostlist, hostname))
|
||||
{
|
||||
fprintf(stderr, "StrPoolAddStr out of memory\n");
|
||||
return;
|
||||
}
|
||||
if (!append_to_list_file(params.hostlist_auto_filename, hostname))
|
||||
{
|
||||
perror("write to auto hostlist:");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
DLOG("auto hostlist : NOT adding %s\n", hostname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user