clientlog: move status check to get_record()
This commit is contained in:
parent
96d652e5bd
commit
d366530699
1 changed files with 1 additions and 10 deletions
11
clientlog.c
11
clientlog.c
|
@ -158,7 +158,7 @@ get_record(IPAddr *ip)
|
||||||
time_t last_hit, oldest_hit = 0;
|
time_t last_hit, oldest_hit = 0;
|
||||||
Record *record, *oldest_record;
|
Record *record, *oldest_record;
|
||||||
|
|
||||||
if (ip->family != IPADDR_INET4 && ip->family != IPADDR_INET6)
|
if (!active || (ip->family != IPADDR_INET4 && ip->family != IPADDR_INET6))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -415,9 +415,6 @@ CLG_GetClientIndex(IPAddr *client)
|
||||||
{
|
{
|
||||||
Record *record;
|
Record *record;
|
||||||
|
|
||||||
if (!active)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
record = get_record(client);
|
record = get_record(client);
|
||||||
if (record == NULL)
|
if (record == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -434,9 +431,6 @@ CLG_LogNTPAccess(IPAddr *client, struct timespec *now)
|
||||||
|
|
||||||
total_ntp_hits++;
|
total_ntp_hits++;
|
||||||
|
|
||||||
if (!active)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
record = get_record(client);
|
record = get_record(client);
|
||||||
if (record == NULL)
|
if (record == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -464,9 +458,6 @@ CLG_LogCommandAccess(IPAddr *client, struct timespec *now)
|
||||||
|
|
||||||
total_cmd_hits++;
|
total_cmd_hits++;
|
||||||
|
|
||||||
if (!active)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
record = get_record(client);
|
record = get_record(client);
|
||||||
if (record == NULL)
|
if (record == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue