diff options
Diffstat (limited to 'src/ats/test_ats_solver_alternative_after_delete_address.c')
-rw-r--r-- | src/ats/test_ats_solver_alternative_after_delete_address.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/ats/test_ats_solver_alternative_after_delete_address.c b/src/ats/test_ats_solver_alternative_after_delete_address.c index 85216419a..aa04e82d5 100644 --- a/src/ats/test_ats_solver_alternative_after_delete_address.c +++ b/src/ats/test_ats_solver_alternative_after_delete_address.c | |||
@@ -106,6 +106,16 @@ static struct GNUNET_HELLO_Address *first_suggestion = NULL; | |||
106 | 106 | ||
107 | static struct GNUNET_HELLO_Address *second_suggestion = NULL; | 107 | static struct GNUNET_HELLO_Address *second_suggestion = NULL; |
108 | 108 | ||
109 | /** | ||
110 | * 1st Address we will destroy. | ||
111 | */ | ||
112 | static struct GNUNET_ATS_AddressRecord *ar; | ||
113 | |||
114 | /** | ||
115 | * 2nd Address we will destroy. | ||
116 | */ | ||
117 | static struct GNUNET_ATS_AddressRecord *ar2; | ||
118 | |||
109 | 119 | ||
110 | static int | 120 | static int |
111 | stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value, | 121 | stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value, |
@@ -198,7 +208,8 @@ address_suggest_cb (void *cls, | |||
198 | 208 | ||
199 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Deleting 1st address for peer `%s' : `%s'\n", | 209 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Deleting 1st address for peer `%s' : `%s'\n", |
200 | GNUNET_i2s (&address->peer), (char *) address->address); | 210 | GNUNET_i2s (&address->peer), (char *) address->address); |
201 | GNUNET_ATS_address_destroyed (sched_ats, address, session); | 211 | GNUNET_ATS_address_destroy (ar); |
212 | ar = NULL; | ||
202 | first_address_deleted = GNUNET_YES; | 213 | first_address_deleted = GNUNET_YES; |
203 | 214 | ||
204 | return; | 215 | return; |
@@ -225,7 +236,8 @@ address_suggest_cb (void *cls, | |||
225 | 236 | ||
226 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Deleting 2nd address for peer `%s' : `%s'\n", | 237 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Deleting 2nd address for peer `%s' : `%s'\n", |
227 | GNUNET_i2s (&address->peer), (char *) address->address); | 238 | GNUNET_i2s (&address->peer), (char *) address->address); |
228 | GNUNET_ATS_address_destroyed (sched_ats, address, session); | 239 | GNUNET_ATS_address_destroy (ar2); |
240 | ar2 = NULL; | ||
229 | second_address_deleted = GNUNET_YES; | 241 | second_address_deleted = GNUNET_YES; |
230 | return; | 242 | return; |
231 | } | 243 | } |
@@ -318,9 +330,11 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, | |||
318 | 330 | ||
319 | 331 | ||
320 | /* Adding address */ | 332 | /* Adding address */ |
321 | GNUNET_ATS_address_add (sched_ats, &test_hello_address, NULL, test_ats_info, test_ats_count); | 333 | ar = GNUNET_ATS_address_add (sched_ats, &test_hello_address, NULL, |
334 | test_ats_info, test_ats_count); | ||
322 | /* Adding alternative address */ | 335 | /* Adding alternative address */ |
323 | GNUNET_ATS_address_add (sched_ats, &alt_test_hello_address, NULL, test_ats_info, test_ats_count); | 336 | ar2 = GNUNET_ATS_address_add (sched_ats, &alt_test_hello_address, NULL, |
337 | test_ats_info, test_ats_count); | ||
324 | } | 338 | } |
325 | 339 | ||
326 | 340 | ||