From f61ed01a3cb8d216da5cfe54c496acfe0732e743 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sun, 19 Jul 2015 09:48:03 +0200 Subject: [PATCH] Remove unused method users_waiting_on_reply() --- src/user.c | 18 ------------------ src/user.h | 1 - tests/user.c | 24 ------------------------ 3 files changed, 43 deletions(-) diff --git a/src/user.c b/src/user.c index 6391573..ce1fa5a 100644 --- a/src/user.c +++ b/src/user.c @@ -92,24 +92,6 @@ users_get_first_ip() return strdup(inet_ntoa(ip)); } -int -users_waiting_on_reply() -{ - int ret; - int i; - - ret = 0; - for (i = 0; i < usercount; i++) { - if (users[i].active && !users[i].disabled && - users[i].last_pkt + 60 > time(NULL) && - users[i].q.id != 0 && users[i].conn == CONN_DNS_NULL) { - ret++; - } - } - - return ret; -} - int find_user_by_ip(uint32_t ip) { diff --git a/src/user.h b/src/user.h index 9f624b3..7d2553a 100644 --- a/src/user.h +++ b/src/user.h @@ -81,7 +81,6 @@ extern struct tun_user *users; int init_users(in_addr_t, int); const char* users_get_first_ip(); -int users_waiting_on_reply(); int find_user_by_ip(uint32_t); int all_users_waiting_to_send(); int find_available_user(); diff --git a/tests/user.c b/tests/user.c index 7d8804e..0bd60c0 100644 --- a/tests/user.c +++ b/tests/user.c @@ -48,30 +48,6 @@ START_TEST(test_init_users) } END_TEST -START_TEST(test_users_waiting) -{ - in_addr_t ip; - - ip = inet_addr("127.0.0.1"); - init_users(ip, 27); - - fail_unless(users_waiting_on_reply() == 0); - - users[3].active = 1; - - fail_unless(users_waiting_on_reply() == 0); - - users[3].last_pkt = time(NULL); - - fail_unless(users_waiting_on_reply() == 0); - - users[3].conn = CONN_DNS_NULL; - users[3].q.id = 1; - - fail_unless(users_waiting_on_reply() == 1); -} -END_TEST - START_TEST(test_find_user_by_ip) { in_addr_t ip;