mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-11 17:29:16 +05:00
recheck domain before adding to autohostlist
This commit is contained in:
parent
d0ce7846c4
commit
7ef7cbe554
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -225,6 +225,12 @@ static void auto_hostlist_failed(const char *hostname)
|
|||||||
{
|
{
|
||||||
DLOG("auto hostlist : fail threshold reached. adding %s to auto hostlist\n", hostname);
|
DLOG("auto hostlist : fail threshold reached. adding %s to auto hostlist\n", hostname);
|
||||||
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
||||||
|
|
||||||
|
DLOG("auto hostlist : rechecking %s to avoid duplicates\n", hostname);
|
||||||
|
bool bExcluded=false;
|
||||||
|
if (!HostlistCheck(params.hostlist, params.hostlist_exclude, hostname, &bExcluded) && !bExcluded)
|
||||||
|
{
|
||||||
|
DLOG("auto hostlist : adding %s\n", hostname);
|
||||||
if (!StrPoolAddStr(¶ms.hostlist, hostname))
|
if (!StrPoolAddStr(¶ms.hostlist, hostname))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "StrPoolAddStr out of memory\n");
|
fprintf(stderr, "StrPoolAddStr out of memory\n");
|
||||||
@ -236,6 +242,9 @@ static void auto_hostlist_failed(const char *hostname)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
DLOG("auto hostlist : NOT adding %s\n", hostname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CONNTRACK_REQUIRED (params.wssize || params.desync_cutoff || *params.hostlist_auto_filename)
|
#define CONNTRACK_REQUIRED (params.wssize || params.desync_cutoff || *params.hostlist_auto_filename)
|
||||||
|
@ -76,6 +76,7 @@ hostfail_pool * HostFailPoolAdd(hostfail_pool **pp,const char *s,int fail_time)
|
|||||||
size_t slen = strlen(s);
|
size_t slen = strlen(s);
|
||||||
ADD_STR_POOL(hostfail_pool, pp, s, slen)
|
ADD_STR_POOL(hostfail_pool, pp, s, slen)
|
||||||
elem->expire = time(NULL) + fail_time;
|
elem->expire = time(NULL) + fail_time;
|
||||||
|
elem->counter = 0;
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s)
|
hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s)
|
||||||
|
@ -76,6 +76,7 @@ hostfail_pool * HostFailPoolAdd(hostfail_pool **pp,const char *s,int fail_time)
|
|||||||
size_t slen = strlen(s);
|
size_t slen = strlen(s);
|
||||||
ADD_STR_POOL(hostfail_pool, pp, s, slen)
|
ADD_STR_POOL(hostfail_pool, pp, s, slen)
|
||||||
elem->expire = time(NULL) + fail_time;
|
elem->expire = time(NULL) + fail_time;
|
||||||
|
elem->counter = 0;
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s)
|
hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s)
|
||||||
|
@ -303,6 +303,12 @@ static void auto_hostlist_failed(const char *hostname)
|
|||||||
{
|
{
|
||||||
VPRINT("auto hostlist : fail threshold reached. adding %s to auto hostlist", hostname);
|
VPRINT("auto hostlist : fail threshold reached. adding %s to auto hostlist", hostname);
|
||||||
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
||||||
|
|
||||||
|
VPRINT("auto hostlist : rechecking %s to avoid duplicates", hostname);
|
||||||
|
bool bExcluded=false;
|
||||||
|
if (!HostlistCheck(params.hostlist, params.hostlist_exclude, hostname, &bExcluded) && !bExcluded)
|
||||||
|
{
|
||||||
|
VPRINT("auto hostlist : adding %s", hostname);
|
||||||
if (!StrPoolAddStr(¶ms.hostlist, hostname))
|
if (!StrPoolAddStr(¶ms.hostlist, hostname))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "StrPoolAddStr out of memory\n");
|
fprintf(stderr, "StrPoolAddStr out of memory\n");
|
||||||
@ -314,6 +320,9 @@ static void auto_hostlist_failed(const char *hostname)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
VPRINT("auto hostlist: NOT adding %s", hostname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tamper_in(t_ctrack *ctrack, uint8_t *segment,size_t segment_buffer_size,size_t *size)
|
void tamper_in(t_ctrack *ctrack, uint8_t *segment,size_t segment_buffer_size,size_t *size)
|
||||||
|
Loading…
Reference in New Issue
Block a user