Remove unused method users_waiting_on_reply()

This commit is contained in:
Erik Ekman 2015-07-19 09:48:03 +02:00
parent 7d915500b7
commit f61ed01a3c
3 changed files with 0 additions and 43 deletions

View File

@ -92,24 +92,6 @@ users_get_first_ip()
return strdup(inet_ntoa(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 int
find_user_by_ip(uint32_t ip) find_user_by_ip(uint32_t ip)
{ {

View File

@ -81,7 +81,6 @@ extern struct tun_user *users;
int init_users(in_addr_t, int); int init_users(in_addr_t, int);
const char* users_get_first_ip(); const char* users_get_first_ip();
int users_waiting_on_reply();
int find_user_by_ip(uint32_t); int find_user_by_ip(uint32_t);
int all_users_waiting_to_send(); int all_users_waiting_to_send();
int find_available_user(); int find_available_user();

View File

@ -48,30 +48,6 @@ START_TEST(test_init_users)
} }
END_TEST 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) START_TEST(test_find_user_by_ip)
{ {
in_addr_t ip; in_addr_t ip;