[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25684 - gnunet/src/testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25684 - gnunet/src/testbed |
Date: |
Thu, 3 Jan 2013 18:27:34 +0100 |
Author: harsha
Date: 2013-01-03 18:27:34 +0100 (Thu, 03 Jan 2013)
New Revision: 25684
Modified:
gnunet/src/testbed/testbed_api.c
gnunet/src/testbed/testbed_api.h
gnunet/src/testbed/testbed_api_peers.c
gnunet/src/testbed/testbed_api_peers.h
Log:
- give more weight to failure events
Modified: gnunet/src/testbed/testbed_api.c
===================================================================
--- gnunet/src/testbed/testbed_api.c 2013-01-03 16:11:02 UTC (rev 25683)
+++ gnunet/src/testbed/testbed_api.c 2013-01-03 17:27:34 UTC (rev 25684)
@@ -939,6 +939,7 @@
{
struct OverlayConnectData *data;
data = opc->data;
+ data->failed = GNUNET_YES;
if (NULL != data->cb)
data->cb (data->cb_cls, opc->op, emsg);
}
@@ -2594,15 +2595,27 @@
* @param index the index of the time slot to update
* @param key the key to identify ownership of the slot
* @param time the new time
+ * @param failed should this reading be treated as coming from a fail event
*/
void
GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c,
unsigned int index,
void *key,
- struct GNUNET_TIME_Relative time)
+ struct GNUNET_TIME_Relative time,
+ int failed)
{
struct TimeSlot *slot;
+ if (GNUNET_YES == failed)
+ {
+ if (1 == c->num_parallel_connects)
+ {
+ GNUNET_TESTBED_set_num_parallel_overlay_connects_ (c, 1);
+ return;
+ }
+ GNUNET_TESTBED_set_num_parallel_overlay_connects_
+ (c, c->num_parallel_connects - 1);
+ }
if (GNUNET_NO == GNUNET_TESTBED_release_time_slot_ (c, index, key))
return;
slot = &c->tslots[index];
Modified: gnunet/src/testbed/testbed_api.h
===================================================================
--- gnunet/src/testbed/testbed_api.h 2013-01-03 16:11:02 UTC (rev 25683)
+++ gnunet/src/testbed/testbed_api.h 2013-01-03 17:27:34 UTC (rev 25684)
@@ -564,12 +564,14 @@
* @param index the index of the time slot to update
* @param key the key to identify ownership of the slot
* @param time the new time
+ * @param failed should this reading be treated as coming from a fail event
*/
void
GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c,
unsigned int index,
void *key,
- struct GNUNET_TIME_Relative time);
+ struct GNUNET_TIME_Relative time,
+ int failed);
/**
Modified: gnunet/src/testbed/testbed_api_peers.c
===================================================================
--- gnunet/src/testbed/testbed_api_peers.c 2013-01-03 16:11:02 UTC (rev
25683)
+++ gnunet/src/testbed/testbed_api_peers.c 2013-01-03 17:27:34 UTC (rev
25684)
@@ -379,7 +379,7 @@
case OPC_STATE_FINISHED:
duration = GNUNET_TIME_absolute_get_duration (data->tstart);
GNUNET_TESTBED_update_time_slot_ (opc->c, data->tslot_index,
- data, duration);
+ data, duration, data->failed);
}
GNUNET_free (data);
GNUNET_free (opc);
Modified: gnunet/src/testbed/testbed_api_peers.h
===================================================================
--- gnunet/src/testbed/testbed_api_peers.h 2013-01-03 16:11:02 UTC (rev
25683)
+++ gnunet/src/testbed/testbed_api_peers.h 2013-01-03 17:27:34 UTC (rev
25684)
@@ -224,6 +224,11 @@
struct GNUNET_TIME_Absolute tstart;
/**
+ * Has this operation failed
+ */
+ int failed;
+
+ /**
* The timing slot index for this operation
*/
unsigned int tslot_index;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25684 - gnunet/src/testbed,
gnunet <=