aboutsummaryrefslogtreecommitdiff
path: root/src/iperf_server_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iperf_server_api.c')
-rw-r--r--src/iperf_server_api.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/iperf_server_api.c b/src/iperf_server_api.c
index 5fa1dd7..272db82 100644
--- a/src/iperf_server_api.c
+++ b/src/iperf_server_api.c
@@ -54,6 +54,7 @@
#include "iperf_tcp.h"
#include "iperf_util.h"
#include "timer.h"
+#include "iperf_time.h"
#include "net.h"
#include "units.h"
#include "iperf_util.h"
@@ -223,7 +224,7 @@ iperf_handle_message_server(struct iperf_test *test)
}
static void
-server_timer_proc(TimerClientData client_data, struct timeval *nowP)
+server_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
{
struct iperf_test *test = client_data.p;
struct iperf_stream *sp;
@@ -243,7 +244,7 @@ server_timer_proc(TimerClientData client_data, struct timeval *nowP)
}
static void
-server_stats_timer_proc(TimerClientData client_data, struct timeval *nowP)
+server_stats_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
{
struct iperf_test *test = client_data.p;
@@ -254,7 +255,7 @@ server_stats_timer_proc(TimerClientData client_data, struct timeval *nowP)
}
static void
-server_reporter_timer_proc(TimerClientData client_data, struct timeval *nowP)
+server_reporter_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
{
struct iperf_test *test = client_data.p;
@@ -267,10 +268,10 @@ server_reporter_timer_proc(TimerClientData client_data, struct timeval *nowP)
static int
create_server_timers(struct iperf_test * test)
{
- struct timeval now;
+ struct iperf_time now;
TimerClientData cd;
- if (gettimeofday(&now, NULL) < 0) {
+ if (iperf_time_now(&now) < 0) {
i_errno = IEINITTEST;
return -1;
}
@@ -304,7 +305,7 @@ create_server_timers(struct iperf_test * test)
}
static void
-server_omit_timer_proc(TimerClientData client_data, struct timeval *nowP)
+server_omit_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
{
struct iperf_test *test = client_data.p;
@@ -324,14 +325,14 @@ server_omit_timer_proc(TimerClientData client_data, struct timeval *nowP)
static int
create_server_omit_timer(struct iperf_test * test)
{
- struct timeval now;
+ struct iperf_time now;
TimerClientData cd;
if (test->omit == 0) {
test->omit_timer = NULL;
test->omitting = 0;
} else {
- if (gettimeofday(&now, NULL) < 0) {
+ if (iperf_time_now(&now) < 0) {
i_errno = IEINITTEST;
return -1;
}
@@ -391,7 +392,7 @@ iperf_run_server(struct iperf_test *test)
#endif /* HAVE_TCP_CONGESTION */
fd_set read_set, write_set;
struct iperf_stream *sp;
- struct timeval now;
+ struct iperf_time now;
struct timeval* timeout;
if (test->affinity != -1)
@@ -428,7 +429,7 @@ iperf_run_server(struct iperf_test *test)
memcpy(&read_set, &test->read_set, sizeof(fd_set));
memcpy(&write_set, &test->write_set, sizeof(fd_set));
- (void) gettimeofday(&now, NULL);
+ iperf_time_now(&now);
timeout = tmr_timeout(&now);
result = select(test->max_fd + 1, &read_set, &write_set, NULL, timeout);
if (result < 0 && errno != EINTR) {
@@ -606,7 +607,7 @@ iperf_run_server(struct iperf_test *test)
if (result == 0 ||
(timeout != NULL && timeout->tv_sec == 0 && timeout->tv_usec == 0)) {
/* Run the timers. */
- (void) gettimeofday(&now, NULL);
+ iperf_time_now(&now);
tmr_run(&now);
}
}