aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_scheduling.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-12-19 12:08:21 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-12-19 12:08:21 +0000
commitee8407d7f7c9f8bfe9658b402ea41b00e54f162c (patch)
tree07c095b3db07b6ca9c1a22f7eb70e65204209b0a /src/ats/ats_api_scheduling.c
parent6082c11f44fc9c7b373d6e9b02e0e194ee5b2982 (diff)
checked mantis #0002016 and added additional assertion
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r--src/ats/ats_api_scheduling.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 4ea7a1cbfb..2dff6c8ac0 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -29,6 +29,8 @@
#define DEBUG_ATS GNUNET_EXTRA_LOGGING
+#define INTERFACE_PROCESSING_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
+
/**
* Message in linked list we should send to the ATS service. The
* actual binary message follows this struct.
@@ -743,8 +745,9 @@ get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
sh->interface_task = GNUNET_SCHEDULER_NO_TASK;
delete_networks (sh);
GNUNET_OS_network_interfaces_list(interface_proc, sh);
-
- sh->interface_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, get_addresses, sh);
+ sh->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVALL,
+ get_addresses,
+ sh);
}
/**
@@ -757,6 +760,7 @@ get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_ATS_Information
GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const struct sockaddr * addr, socklen_t addrlen)
{
+ GNUNET_assert (sh != NULL);
struct GNUNET_ATS_Information ats;
struct ATS_Network * cur = sh->net_head;
int type = GNUNET_ATS_NET_UNSPECIFIED;
@@ -886,7 +890,9 @@ GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
sh->suggest_cb_cls = suggest_cb_cls;
GNUNET_array_grow (sh->session_array, sh->session_array_size, 4);
GNUNET_OS_network_interfaces_list(interface_proc, sh);
- sh->interface_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, get_addresses, sh);
+ sh->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVALL,
+ get_addresses,
+ sh);
reconnect (sh);
return sh;
}
@@ -924,9 +930,9 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh)
GNUNET_SCHEDULER_cancel(sh->interface_task);
sh->interface_task = GNUNET_SCHEDULER_NO_TASK;
}
-
GNUNET_array_grow (sh->session_array, sh->session_array_size, 0);
GNUNET_free (sh);
+ sh = NULL;
}