aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_topology.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-10-22 11:44:04 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-10-22 11:44:04 +0000
commitf54cf6c01e2dac998c64249d72eb92dbf5d056db (patch)
tree18ed9fed6accd78bf526c2d959644d8efeee9abe /src/testbed/testbed_api_topology.c
parent76f59cc8768739288704cd3f6d3864760be035d0 (diff)
downloadgnunet-f54cf6c01e2dac998c64249d72eb92dbf5d056db.tar.gz
gnunet-f54cf6c01e2dac998c64249d72eb92dbf5d056db.zip
option for disabling auto retry
Diffstat (limited to 'src/testbed/testbed_api_topology.c')
-rw-r--r--src/testbed/testbed_api_topology.c31
1 files changed, 27 insertions, 4 deletions
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);