channel = ch;
}
th = GNUNET_CADET_notify_transmit_ready (channel, GNUNET_NO,
- GNUNET_TIME_UNIT_FOREVER_REL,
- size_payload, &tmt_rdy, (void *) 1L);
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ size_payload + data_sent,
+ &tmt_rdy, (void *) 1L);
if (NULL == th)
{
unsigned long i = (unsigned long) cls;
case 0L:
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Root client got a message!\n");
break;
- case 2L:
+ case 1L:
case 4L:
GNUNET_assert (client == peers_requested - 1);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
client);
break;
default:
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Client %li not valid.\n", client);
GNUNET_abort ();
- break;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: (%d/%d)\n", ok, ok_goal);
data = (uint32_t *) &message[1];
}
else
{
- expected_target_client = 4L;
+ expected_target_client = peers_requested - 1;
}
if (GNUNET_NO == initialized)
start_time = GNUNET_TIME_absolute_get ();
if (SPEED == test)
{
- GNUNET_assert (4L == client);
+ GNUNET_assert (peers_requested - 1 == client);
GNUNET_SCHEDULER_add_now (&data_task, NULL);
return GNUNET_OK;
}
if (SPEED != test || (ok_goal - 2) == ok)
{
GNUNET_CADET_notify_transmit_ready (channel, GNUNET_NO,
- GNUNET_TIME_UNIT_FOREVER_REL,
- size_payload, &tmt_rdy, (void *) 1L);
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ size_payload + data_sent,
+ &tmt_rdy, (void *) 1L);
return GNUNET_OK;
}
else
data_ack++;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", data_ack);
GNUNET_CADET_notify_transmit_ready (channel, GNUNET_NO,
- GNUNET_TIME_UNIT_FOREVER_REL,
- size_payload, &tmt_rdy, (void *) 1L);
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ size_payload + data_sent,
+ &tmt_rdy, (void *) 1L);
if (data_ack < TOTAL_PACKETS && SPEED != test)
return GNUNET_OK;
if (ok == 2 && SPEED == test)
if (0 == strncmp (s_sent, name, strlen (s_sent)) && 0 == i)
ka_sent = value;
- if (0 == strncmp(s_recv, name, strlen (s_recv)) && 4 == i)
+ if (0 == strncmp(s_recv, name, strlen (s_recv)) && peers_requested - 1 == i)
ka_received = value;
return GNUNET_OK;
disconnect_task = GNUNET_SCHEDULER_NO_TASK;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "check keepalives\n");
GNUNET_CADET_channel_destroy (ch);
- stats_op = GNUNET_TESTBED_get_statistics (5, testbed_peers,
+ stats_op = GNUNET_TESTBED_get_statistics (peers_running, testbed_peers,
"cadet", NULL,
stats_iterator, stats_cont, NULL);
}
GNUNET_i2s (initiator), (long) cls);
ok++;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
- if ((long) cls == 4L)
+ if ((long) cls == peers_requested - 1)
incoming_ch = channel;
else
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Incoming channel disconnected at peer %ld\n", i);
- if (4L == i)
+ if (peers_running - 1 == i)
{
ok++;
GNUNET_break (channel == incoming_ch);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start\n");
/* Find out requested size */
- if (strstr (argv[0], "test_direct") != NULL)
+ if (strstr (argv[0], "_2_") != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DIRECT CONNECTIONs\n");
peers_requested = 2;
}
- else if (strstr (argv[0], "test_small") != NULL)
+ else if (strstr (argv[0], "_5_") != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "5 PEER LINE\n");
peers_requested = 5;
}
/* Find out requested test */
- if (strstr (argv[0], "_cadet_forward") != NULL)
+ if (strstr (argv[0], "_forward") != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FORWARD\n");
test = FORWARD;
test_name = "unicast";
ok_goal = 4;
}
- else if (strstr (argv[0], "_cadet_signal") != NULL)
+ else if (strstr (argv[0], "_signal") != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SIGNAL\n");
test = P2P_SIGNAL;
test_name = "signal";
ok_goal = 4;
}
- else if (strstr (argv[0], "_cadet_speed_ack") != NULL)
+ else if (strstr (argv[0], "_speed_ack") != NULL)
{
/* Test is supposed to generate the following callbacks:
* 1 incoming channel (@dest)
test = SPEED_ACK;
test_name = "speed ack";
}
- else if (strstr (argv[0], "_cadet_speed") != NULL)
+ else if (strstr (argv[0], "_speed") != NULL)
{
/* Test is supposed to generate the following callbacks:
* 1 incoming channel (@dest)