aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-03 17:27:34 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-03 17:27:34 +0000
commit129fe6c83b9fa2ffcf94fb39df42dbcadc97ca24 (patch)
tree7fa5ee3d41f803dfaea5023960ac5e420665e958 /src/testbed
parentb53d7bfde8da84afaa7ee8888d15f1cc6cffd866 (diff)
downloadgnunet-129fe6c83b9fa2ffcf94fb39df42dbcadc97ca24.tar.gz
gnunet-129fe6c83b9fa2ffcf94fb39df42dbcadc97ca24.zip
- give more weight to failure events
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/testbed_api.c15
-rw-r--r--src/testbed/testbed_api.h4
-rw-r--r--src/testbed/testbed_api_peers.c2
-rw-r--r--src/testbed/testbed_api_peers.h5
4 files changed, 23 insertions, 3 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c
index 6894528a7..91da8b5c9 100644
--- a/src/testbed/testbed_api.c
+++ b/src/testbed/testbed_api.c
@@ -939,6 +939,7 @@ handle_op_fail_event (struct GNUNET_TESTBED_Controller *c,
939 { 939 {
940 struct OverlayConnectData *data; 940 struct OverlayConnectData *data;
941 data = opc->data; 941 data = opc->data;
942 data->failed = GNUNET_YES;
942 if (NULL != data->cb) 943 if (NULL != data->cb)
943 data->cb (data->cb_cls, opc->op, emsg); 944 data->cb (data->cb_cls, opc->op, emsg);
944 } 945 }
@@ -2594,15 +2595,27 @@ GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c,
2594 * @param index the index of the time slot to update 2595 * @param index the index of the time slot to update
2595 * @param key the key to identify ownership of the slot 2596 * @param key the key to identify ownership of the slot
2596 * @param time the new time 2597 * @param time the new time
2598 * @param failed should this reading be treated as coming from a fail event
2597 */ 2599 */
2598void 2600void
2599GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c, 2601GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c,
2600 unsigned int index, 2602 unsigned int index,
2601 void *key, 2603 void *key,
2602 struct GNUNET_TIME_Relative time) 2604 struct GNUNET_TIME_Relative time,
2605 int failed)
2603{ 2606{
2604 struct TimeSlot *slot; 2607 struct TimeSlot *slot;
2605 2608
2609 if (GNUNET_YES == failed)
2610 {
2611 if (1 == c->num_parallel_connects)
2612 {
2613 GNUNET_TESTBED_set_num_parallel_overlay_connects_ (c, 1);
2614 return;
2615 }
2616 GNUNET_TESTBED_set_num_parallel_overlay_connects_
2617 (c, c->num_parallel_connects - 1);
2618 }
2606 if (GNUNET_NO == GNUNET_TESTBED_release_time_slot_ (c, index, key)) 2619 if (GNUNET_NO == GNUNET_TESTBED_release_time_slot_ (c, index, key))
2607 return; 2620 return;
2608 slot = &c->tslots[index]; 2621 slot = &c->tslots[index];
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h
index b82c374ad..7586ed28d 100644
--- a/src/testbed/testbed_api.h
+++ b/src/testbed/testbed_api.h
@@ -564,12 +564,14 @@ GNUNET_TESTBED_get_tslot_ (struct GNUNET_TESTBED_Controller *c, void *key);
564 * @param index the index of the time slot to update 564 * @param index the index of the time slot to update
565 * @param key the key to identify ownership of the slot 565 * @param key the key to identify ownership of the slot
566 * @param time the new time 566 * @param time the new time
567 * @param failed should this reading be treated as coming from a fail event
567 */ 568 */
568void 569void
569GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c, 570GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c,
570 unsigned int index, 571 unsigned int index,
571 void *key, 572 void *key,
572 struct GNUNET_TIME_Relative time); 573 struct GNUNET_TIME_Relative time,
574 int failed);
573 575
574 576
575/** 577/**
diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c
index d558ef06d..1c0e87557 100644
--- a/src/testbed/testbed_api_peers.c
+++ b/src/testbed/testbed_api_peers.c
@@ -379,7 +379,7 @@ oprelease_overlay_connect (void *cls)
379 case OPC_STATE_FINISHED: 379 case OPC_STATE_FINISHED:
380 duration = GNUNET_TIME_absolute_get_duration (data->tstart); 380 duration = GNUNET_TIME_absolute_get_duration (data->tstart);
381 GNUNET_TESTBED_update_time_slot_ (opc->c, data->tslot_index, 381 GNUNET_TESTBED_update_time_slot_ (opc->c, data->tslot_index,
382 data, duration); 382 data, duration, data->failed);
383 } 383 }
384 GNUNET_free (data); 384 GNUNET_free (data);
385 GNUNET_free (opc); 385 GNUNET_free (opc);
diff --git a/src/testbed/testbed_api_peers.h b/src/testbed/testbed_api_peers.h
index f02079926..b1f226214 100644
--- a/src/testbed/testbed_api_peers.h
+++ b/src/testbed/testbed_api_peers.h
@@ -224,6 +224,11 @@ struct OverlayConnectData
224 struct GNUNET_TIME_Absolute tstart; 224 struct GNUNET_TIME_Absolute tstart;
225 225
226 /** 226 /**
227 * Has this operation failed
228 */
229 int failed;
230
231 /**
227 * The timing slot index for this operation 232 * The timing slot index for this operation
228 */ 233 */
229 unsigned int tslot_index; 234 unsigned int tslot_index;