mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 18:15:13 +00:00
Remove unused method users_waiting_on_reply()
This commit is contained in:
parent
7d915500b7
commit
f61ed01a3c
18
src/user.c
18
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)
|
||||
{
|
||||
|
@ -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();
|
||||
|
24
tests/user.c
24
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;
|
||||
|
Loading…
Reference in New Issue
Block a user