diff --git a/api.h b/api.h index b012cc93..1e925ba5 100644 --- a/api.h +++ b/api.h @@ -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); diff --git a/api_stats.c b/api_stats.c index 24b67063..5e74d57e 100644 --- a/api_stats.c +++ b/api_stats.c @@ -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", diff --git a/request.c b/request.c index 269185b7..f5396d84 100644 --- a/request.c +++ b/request.c @@ -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")) {