diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-22 11:44:04 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-22 11:44:04 +0000 |
commit | f54cf6c01e2dac998c64249d72eb92dbf5d056db (patch) | |
tree | 18ed9fed6accd78bf526c2d959644d8efeee9abe /src/testbed | |
parent | 76f59cc8768739288704cd3f6d3864760be035d0 (diff) | |
download | gnunet-f54cf6c01e2dac998c64249d72eb92dbf5d056db.tar.gz gnunet-f54cf6c01e2dac998c64249d72eb92dbf5d056db.zip |
option for disabling auto retry
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/gnunet-testbed-profiler.c | 4 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_topology.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api_topology.c | 31 |
3 files changed, 30 insertions, 7 deletions
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 21faaa74a..b01e992b9 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -334,8 +334,8 @@ peer_churn_cb (void *cls, const char *emsg) | |||
334 | topology_op = | 334 | topology_op = |
335 | GNUNET_TESTBED_overlay_configure_topology (NULL, num_peers, peers, | 335 | GNUNET_TESTBED_overlay_configure_topology (NULL, num_peers, peers, |
336 | GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, | 336 | GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, |
337 | 337 | num_links, | |
338 | num_links); | 338 | GNUNET_TESTBED_TOPOLOGY_OPTION_END); |
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c index 8e673d293..af3890ea5 100644 --- a/src/testbed/test_testbed_api_topology.c +++ b/src/testbed/test_testbed_api_topology.c | |||
@@ -136,7 +136,7 @@ test_master (void *cls, unsigned int num_peers, | |||
136 | overlay_connects = 0; | 136 | overlay_connects = 0; |
137 | op = GNUNET_TESTBED_overlay_configure_topology (NULL, NUM_PEERS, peers, | 137 | op = GNUNET_TESTBED_overlay_configure_topology (NULL, NUM_PEERS, peers, |
138 | GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, | 138 | GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, |
139 | NUM_PEERS); | 139 | NUM_PEERS, GNUNET_TESTBED_TOPOLOGY_OPTION_END); |
140 | GNUNET_assert (NULL != op); | 140 | GNUNET_assert (NULL != op); |
141 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 141 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
142 | (GNUNET_TIME_UNIT_SECONDS, 120), | 142 | (GNUNET_TIME_UNIT_SECONDS, 120), |
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c index bc766dedb..08d812e5e 100644 --- a/src/testbed/testbed_api_topology.c +++ b/src/testbed/testbed_api_topology.c | |||
@@ -94,7 +94,12 @@ struct TopologyContext | |||
94 | /** | 94 | /** |
95 | * The size of the link array | 95 | * The size of the link array |
96 | */ | 96 | */ |
97 | unsigned int link_array_size; | 97 | unsigned int link_array_size; |
98 | |||
99 | /** | ||
100 | * should the automatic retry be disabled | ||
101 | */ | ||
102 | int disable_retry; | ||
98 | 103 | ||
99 | }; | 104 | }; |
100 | 105 | ||
@@ -117,10 +122,10 @@ overlay_link_completed (void *cls, | |||
117 | 122 | ||
118 | GNUNET_assert (op == link->op); | 123 | GNUNET_assert (op == link->op); |
119 | GNUNET_TESTBED_operation_done (op); | 124 | GNUNET_TESTBED_operation_done (op); |
120 | link->op = NULL; | 125 | link->op = NULL; |
121 | if (NULL != emsg) | 126 | tc = link->tc; |
127 | if ((NULL != emsg) && (GNUNET_NO == tc->disable_retry)) | ||
122 | { | 128 | { |
123 | tc = link->tc; | ||
124 | LOG (GNUNET_ERROR_TYPE_WARNING, | 129 | LOG (GNUNET_ERROR_TYPE_WARNING, |
125 | "Error while establishing a link: %s -- Retrying\n", emsg); | 130 | "Error while establishing a link: %s -- Retrying\n", emsg); |
126 | link->op = | 131 | link->op = |
@@ -251,6 +256,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | |||
251 | struct TopologyContext *tc; | 256 | struct TopologyContext *tc; |
252 | struct GNUNET_TESTBED_Operation *op; | 257 | struct GNUNET_TESTBED_Operation *op; |
253 | struct GNUNET_TESTBED_Controller *c; | 258 | struct GNUNET_TESTBED_Controller *c; |
259 | enum GNUNET_TESTBED_TopologyOption secondary_option; | ||
254 | unsigned int cnt; | 260 | unsigned int cnt; |
255 | 261 | ||
256 | if (num_peers < 2) | 262 | if (num_peers < 2) |
@@ -296,6 +302,22 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | |||
296 | GNUNET_break (0); | 302 | GNUNET_break (0); |
297 | return NULL; | 303 | return NULL; |
298 | } | 304 | } |
305 | do | ||
306 | { | ||
307 | secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption); | ||
308 | switch (secondary_option) | ||
309 | { | ||
310 | case GNUNET_TESTBED_TOPOLOGY_DISABLE_AUTO_RETRY: | ||
311 | tc->disable_retry = GNUNET_YES; | ||
312 | break; | ||
313 | case GNUNET_TESTBED_TOPOLOGY_OPTION_END: | ||
314 | break; | ||
315 | default: | ||
316 | GNUNET_break (0); /* Should not use any other option apart from | ||
317 | the ones handled here */ | ||
318 | return NULL; | ||
319 | } | ||
320 | } while (GNUNET_TESTBED_TOPOLOGY_OPTION_END != secondary_option); | ||
299 | op = GNUNET_TESTBED_operation_create_ (tc, | 321 | op = GNUNET_TESTBED_operation_create_ (tc, |
300 | &opstart_overlay_configure_topology, | 322 | &opstart_overlay_configure_topology, |
301 | &oprelease_overlay_configure_topology); | 323 | &oprelease_overlay_configure_topology); |
@@ -328,6 +350,7 @@ GNUNET_TESTBED_overlay_configure_topology (void *op_cls, unsigned int num_peers, | |||
328 | struct GNUNET_TESTBED_Operation *op; | 350 | struct GNUNET_TESTBED_Operation *op; |
329 | va_list vargs; | 351 | va_list vargs; |
330 | 352 | ||
353 | GNUNET_assert (topo < GNUNET_TESTBED_TOPOLOGY_OPTION_END); | ||
331 | va_start (vargs, topo); | 354 | va_start (vargs, topo); |
332 | op = GNUNET_TESTBED_overlay_configure_topology_va (op_cls, num_peers, peers, | 355 | op = GNUNET_TESTBED_overlay_configure_topology_va (op_cls, num_peers, peers, |
333 | topo, vargs); | 356 | topo, vargs); |