}
}
-size_t
+static size_t
tmt_rdy (void *cls, size_t size, void *buf);
static void
struct GNUNET_MESH_TransmitHandle *th;
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
return;
- th = GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0,
+ th = GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
GNUNET_TIME_UNIT_FOREVER_REL, &d2->id,
sizeof (struct GNUNET_MessageHeader),
&tmt_rdy, (void *) 1L);
}
if (test == MULTICAST && peers_responded < 2)
return GNUNET_OK;
- if (test == SPEED_ACK)
+ if (test == SPEED_ACK || test == SPEED)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
" received ack %u\n", data_ack);
- GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
+ GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO,
GNUNET_TIME_UNIT_FOREVER_REL, sender,
sizeof (struct GNUNET_MessageHeader),
&tmt_rdy, (void *) 1L);
- if (data_ack < 1000)
+ if (data_ack < 1000 && test != SPEED)
return GNUNET_OK;
end_time = GNUNET_TIME_absolute_get();
total_time = GNUNET_TIME_absolute_get_difference(start_time, end_time);
FPRINTF (stderr, "\nTest time %llu ms\n",
(unsigned long long) total_time.rel_value);
FPRINTF (stderr, "Test bandwidth: %f kb/s\n",
- 4000.0 / total_time.rel_value);
- FPRINTF (stderr, "Test throughput: %f packets/s\n",
- 1000000.0 / total_time.rel_value);
- GAUGER ("MESH", "Tunnel 5 peers", 1000000.0 / total_time.rel_value,
+ 4 * 1000.0 / total_time.rel_value); // 4bytes * ms
+ FPRINTF (stderr, "Test throughput: %f packets/s\n\n",
+ 1000.0 * 1000.0 / total_time.rel_value); // 1000 packets * ms
+ GAUGER ("MESH", "Tunnel 5 peers", 1000.0 * 1000.0 / total_time.rel_value,
"packets/s");
}
GNUNET_assert (tunnel == t);
client);
ok++;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
- if (SPEED != test)
+ if (SPEED != test || 1002 == ok)
{
- GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
+ GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO,
GNUNET_TIME_UNIT_FOREVER_REL, sender,
sizeof (struct GNUNET_MessageHeader),
&tmt_rdy, (void *) 1L);
data_received = 0;
data_sent = 0;
start_time = GNUNET_TIME_absolute_get();
- GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0,
+ GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
GNUNET_TIME_UNIT_FOREVER_REL, dest,
sizeof (struct GNUNET_MessageHeader),
&tmt_rdy, (void *) 1L);
GNUNET_i2s (&d3->id));
}
#endif
- h1 = GNUNET_MESH_connect (d1->cfg, 5, (void *) 1L, NULL, &tunnel_cleaner,
+ h1 = GNUNET_MESH_connect (d1->cfg, (void *) 1L, NULL, &tunnel_cleaner,
handlers, &app);
- h2 = GNUNET_MESH_connect (d2->cfg, 5, (void *) 2L, &incoming_tunnel,
+ h2 = GNUNET_MESH_connect (d2->cfg, (void *) 2L, &incoming_tunnel,
&tunnel_cleaner, handlers, &app);
if (test == MULTICAST)
{
- h3 = GNUNET_MESH_connect (d3->cfg, 5, (void *) 3L, &incoming_tunnel,
+ h3 = GNUNET_MESH_connect (d3->cfg, (void *) 3L, &incoming_tunnel,
&tunnel_cleaner, handlers, &app);
}
t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L);
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting daemons.\n");
- GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
+ GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing_old",
"use_progressbars", "YES");
#endif
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
+ GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old",
"num_peers", &num_peers))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
}
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (testing_cfg, "testing",
+ GNUNET_CONFIGURATION_get_value_string (testing_cfg, "testing_old",
"topology_output_file",
&topology_file))
{
hosts);
GNUNET_assert (pg != NULL);
shutdown_handle =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task, NULL);
}
* 1 incoming tunnel (@dest)
* 1 connected peer (@orig)
* 1000 received data packet (@dest)
+ * 1received data packet (@orig)
* 1 received tunnel destroy (@dest)
* _________________________________
- * 5 x ok expected per peer
*/
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n");
test = SPEED;
- ok_goal = 1003;
+ ok_goal = 1004;
}
else
{