Use istelnet[] in getStats()

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-01-04 19:33:20 +01:00
parent 203cc946bd
commit f0793be61b
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
* Please see LICENSE file for your rights under this license. */
// Statistic methods
void getStats(int *sock, char type);
void getStats(int *sock);
void getOverTime(int *sock, char type);
void getTopDomains (char *client_message, int *sock, char type);
void getTopClients(char *client_message, int *sock, char type);
+3 -3
View File
@@ -42,7 +42,7 @@ int cmpdesc(const void *a, const void *b)
return 0;
}
void getStats(int *sock, char type)
void getStats(int *sock)
{
int blocked = counters.blocked + counters.wildcardblocked;
int total = counters.queries - counters.invalidqueries;
@@ -59,7 +59,7 @@ void getStats(int *sock, char type)
switch(blockingstatus)
{
case 0: // Blocking disabled
if(type == TELNET)
if(istelnet[*sock])
strncpy(domains_blocked, "N/A", 4);
else
strncpy(domains_blocked, "\"N/A\"", 6);
@@ -85,7 +85,7 @@ void getStats(int *sock, char type)
activeclients++;
}
if(type == TELNET) {
if(istelnet[*sock]) {
ssend(*sock, "domains_being_blocked %s\ndns_queries_today %i\nads_blocked_today %i\nads_percentage_today %f\n",
domains_blocked, total, blocked, percentage);
ssend(*sock, "unique_domains %i\nqueries_forwarded %i\nqueries_cached %i\n",
+1 -1
View File
@@ -21,7 +21,7 @@ void process_request(char *client_message, int *sock, char type)
if(command(client_message, ">stats"))
{
processed = true;
getStats(sock, type);
getStats(sock);
}
else if(command(client_message, ">overTime"))
{