test_cadet_2_speed_backwards \
test_cadet_2_speed_reliable \
test_cadet_2_speed_reliable_backwards \
+ test_cadet_2_reopen \
test_cadet_5_forward \
test_cadet_5_signal \
test_cadet_5_keepalive \
test_cadet_5_speed_ack \
test_cadet_5_speed_reliable \
test_cadet_5_speed_reliable_backwards \
- test_cadet_5_speed_backwards
+ test_cadet_5_speed_backwards \
+ test_cadet_5_reopen
endif
test_cadet.c
test_cadet_5_speed_reliable_backwards_LDADD = $(ld_cadet_test_lib)
+test_cadet_2_reopen_SOURCES = \
+ test_cadet.c
+test_cadet_2_reopen_LDADD = $(ld_cadet_test_lib)
+
+test_cadet_5_reopen_SOURCES = \
+ test_cadet.c
+test_cadet_5_reopen_LDADD = $(ld_cadet_test_lib)
+
if ENABLE_TEST_RUN
AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
#define SPEED_ACK 4
#define SPEED_REL 8
#define P2P_SIGNAL 10
+#define REOPEN 11
/**
* Which test are we running?
*/
static struct GNUNET_SCHEDULER_Task *disconnect_task;
+/**
+ * Task called to reconnect peers.
+ */
+static struct GNUNET_SCHEDULER_Task *reconnect_task;
+
/**
* Task To perform tests
*/
"KA sent: %u, KA received: %u\n",
ka_sent,
ka_received);
- if ((KEEPALIVE == test) && ((ka_sent < 2) || (ka_sent > ka_received + 1)))
+ if ((KEEPALIVE == test || REOPEN == test) &&
+ ((ka_sent < 2) || (ka_sent > ka_received + 1)))
{
GNUNET_break (0);
ok--;
}
+/**
+ * Send a message on the channel with the appropriate size and payload.
+ *
+ * Update the appropriate *_sent counter.
+ *
+ * @param channel Channel to send the message on.
+ */
+static void
+send_test_message (struct GNUNET_CADET_Channel *channel);
+
+/**
+ * Check if payload is sane (size contains payload).
+ *
+ * @param cls should match #ch
+ * @param message The actual message.
+ * @return #GNUNET_OK to keep the channel open,
+ * #GNUNET_SYSERR to close it (signal serious error).
+ */
+static int
+check_data (void *cls,
+ const struct GNUNET_MessageHeader *message);
+
+/**
+ * Function is called whenever a message is received.
+ *
+ * @param cls closure (set from GNUNET_CADET_connect(), peer number)
+ * @param message the actual message
+ */
+static void
+handle_data (void *cls,
+ const struct GNUNET_MessageHeader *message);
+
+/**
+ * Function called whenever an MQ-channel is destroyed, even if the destruction
+ * was requested by #GNUNET_CADET_channel_destroy.
+ * It must NOT call #GNUNET_CADET_channel_destroy on the channel.
+ *
+ * It should clean up any associated state, including cancelling any pending
+ * transmission on this channel.
+ *
+ * @param cls Channel closure (channel wrapper).
+ * @param channel Connection to the other end (henceforth invalid).
+ */
+static void
+disconnect_handler (void *cls,
+ const struct GNUNET_CADET_Channel *channel);
+
+
+/**
+ * Task to reconnect to other peer.
+ *
+ * @param cls Closure (line from which the task was scheduled).
+ */
+static void
+reconnect_op (void *cls)
+{
+ struct GNUNET_MQ_MessageHandler handlers[] = {
+ GNUNET_MQ_hd_var_size (data,
+ GNUNET_MESSAGE_TYPE_DUMMY,
+ struct GNUNET_MessageHeader,
+ NULL),
+ GNUNET_MQ_handler_end ()
+ };
+ long l = (long) cls;
+ struct CadetTestChannelWrapper *ch;
+ enum GNUNET_CADET_ChannelOption flags;
+
+ reconnect_task = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "reconnecting from line %ld\n",
+ l);
+ if (NULL != outgoing_ch)
+ {
+ GNUNET_CADET_channel_destroy (outgoing_ch);
+ outgoing_ch = NULL;
+ }
+ flags = GNUNET_CADET_OPTION_DEFAULT;
+ ch = GNUNET_new (struct CadetTestChannelWrapper);
+ outgoing_ch = GNUNET_CADET_channel_create (h1,
+ ch,
+ p_id[1],
+ &port,
+ flags,
+ NULL,
+ &disconnect_handler,
+ handlers);
+ ch->ch = outgoing_ch;
+ send_test_message (outgoing_ch);
+}
+
+/**
+ * Function called whenever an MQ-channel is destroyed, even if the destruction
+ * was requested by #GNUNET_CADET_channel_destroy.
+ * It must NOT call #GNUNET_CADET_channel_destroy on the channel.
+ *
+ * It should clean up any associated state, including cancelling any pending
+ * transmission on this channel.
+ *
+ * @param cls Channel closure (channel wrapper).
+ * @param channel Connection to the other end (henceforth invalid).
+ */
+static void
+disconnect_handler (void *cls,
+ const struct GNUNET_CADET_Channel *channel)
+{
+ struct CadetTestChannelWrapper *ch_w = cls;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Channel disconnected at %d\n",
+ ok);
+ GNUNET_assert (ch_w->ch == channel);
+ if (channel == incoming_ch)
+ {
+ ok++;
+ incoming_ch = NULL;
+ }
+ else if (outgoing_ch == channel)
+ {
+ if (P2P_SIGNAL == test)
+ {
+ ok++;
+ }
+ outgoing_ch = NULL;
+ }
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Unknown channel! %p\n",
+ channel);
+ if (NULL != disconnect_task && REOPEN != test)
+ {
+ GNUNET_SCHEDULER_cancel (disconnect_task);
+ disconnect_task =
+ GNUNET_SCHEDULER_add_now (&gather_stats_and_exit,
+ (void *) __LINE__);
+ }
+ else if (NULL != reconnect_task && REOPEN == test)
+ {
+ GNUNET_SCHEDULER_cancel (reconnect_task);
+ reconnect_task =
+ GNUNET_SCHEDULER_add_now (&reconnect_op,
+ (void *) __LINE__);
+ }
+ GNUNET_free (ch_w);
+}
+
+
/**
* Abort test: schedule disconnect and shutdown immediately
*
{
payload = data_sent;
}
+ else if (REOPEN == test)
+ {
+ payload = data_sent;
+ data_sent++;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Sending DATA %u [%d bytes]\n",
+ data_sent, size);
+ }
else
{
GNUNET_assert (0);
(long) cls);
GNUNET_assert (0);
}
- if (NULL != disconnect_task)
+ if (NULL != disconnect_task && REOPEN != test)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_delayed (short_time,
&gather_stats_and_exit,
(void *) __LINE__);
}
+ else if ((NULL != disconnect_task) && (REOPEN == test))
+ {
+ GNUNET_SCHEDULER_cancel (disconnect_task);
+ disconnect_task = GNUNET_SCHEDULER_add_delayed (
+ GNUNET_TIME_relative_multiply (short_time, 2),
+ &gather_stats_and_exit,
+ (void *) __LINE__);
+ }
+
+ if ((NULL != reconnect_task) && (REOPEN == test))
+ {
+ GNUNET_SCHEDULER_cancel (reconnect_task);
+ reconnect_task = GNUNET_SCHEDULER_add_delayed (short_time,
+ &reconnect_op,
+ (void *) __LINE__);
+ }
/* TODO: cannot return channel as-is, in order to unify the data handlers */
ch = GNUNET_new (struct CadetTestChannelWrapper);
}
-/**
- * Function called whenever an MQ-channel is destroyed, even if the destruction
- * was requested by #GNUNET_CADET_channel_destroy.
- * It must NOT call #GNUNET_CADET_channel_destroy on the channel.
- *
- * It should clean up any associated state, including cancelling any pending
- * transmission on this channel.
- *
- * @param cls Channel closure (channel wrapper).
- * @param channel Connection to the other end (henceforth invalid).
- */
-static void
-disconnect_handler (void *cls,
- const struct GNUNET_CADET_Channel *channel)
-{
- struct CadetTestChannelWrapper *ch_w = cls;
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Channel disconnected at %d\n",
- ok);
- GNUNET_assert (ch_w->ch == channel);
- if (channel == incoming_ch)
- {
- ok++;
- incoming_ch = NULL;
- }
- else if (outgoing_ch == channel)
- {
- if (P2P_SIGNAL == test)
- {
- ok++;
- }
- outgoing_ch = NULL;
- }
- else
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Unknown channel! %p\n",
- channel);
- if (NULL != disconnect_task)
- {
- GNUNET_SCHEDULER_cancel (disconnect_task);
- disconnect_task =
- GNUNET_SCHEDULER_add_now (&gather_stats_and_exit,
- (void *) __LINE__);
- }
- GNUNET_free (ch_w);
-}
-
-
/**
* START THE TESTCASE ITSELF, AS WE ARE CONNECTED TO THE CADET SERVICES.
*
enum GNUNET_CADET_ChannelOption flags;
test_task = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "start_test\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "start_test: %s\n", test_name);
if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
if (KEEPALIVE == test)
return; /* Don't send any data. */
-
data_received = 0;
data_sent = 0;
ack_received = 0;
"Sending data initializer on channel %p...\n",
outgoing_ch);
send_test_message (outgoing_ch);
+ if (REOPEN == test)
+ {
+ reconnect_task = GNUNET_SCHEDULER_add_delayed (short_time,
+ &reconnect_op,
+ (void *) __LINE__);
+ GNUNET_SCHEDULER_cancel (disconnect_task);
+ disconnect_task = GNUNET_SCHEDULER_add_delayed (
+ GNUNET_TIME_relative_multiply (short_time, 2),
+ &gather_stats_and_exit,
+ (void *) __LINE__);
+ }
+
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "5 PEER LINE\n");
peers_requested = 5;
}
+ else if (strstr (argv[0], "_6_") != NULL)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "6 PEER LINE\n");
+ peers_requested = 6;
+ }
else
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "SIZE UNKNOWN, USING 2\n");
*/
ok_goal = 2;
}
+ else if (strstr (argv[0], "_reopen") != NULL)
+ {
+ test = REOPEN;
+ test_name = "reopen";
+ ///* Test is supposed to generate the following callbacks:
+ // * 1 incoming channel (@dest)
+ // * [wait]
+ // * 1 received channel destroy (@dest)
+ // */
+ ok_goal = 7;
+ }
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "UNKNOWN\n");
for (uint32_t i = 0; i < num_peers; i++)
{
- to_file ("/tmp/rps/final_stats.dat",
- "%" PRIu32 " " /* index */
- "%s %" /* id */
- PRIu64 " %" /* rounds */
- PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" /* blocking */
- PRIu64 " %" PRIu64 " %" PRIu64 " %" /* issued */
- PRIu64 " %" PRIu64 " %" PRIu64 " %" /* sent */
- PRIu64 " %" PRIu64 " %" PRIu64 /* recv */,
+ to_file ("/tmp/rps/final_stats.csv",
+ ", %" PRIu32 ", " /* index */
+ "%s, %" /* id */
+ PRIu64 ", %" /* rounds */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* blocking */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* issued */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* sent */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 /* recv */,
i,
GNUNET_i2s (rps_peers[i].peer_id),
rps_peers[i].stats[STAT_TYPE_ROUNDS],
GNUNET_TESTBED_operation_done (rps_peer->stat_op);
}
- write_final_stats ();
+ //write_final_stats ();
if (GNUNET_YES == check_statistics_collect_completed())
{
- //write_final_stats ();
+ write_final_stats ();
GNUNET_free (stat_cls);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Shutting down\n");
struct PendingMessage *pending_messages_head;
struct PendingMessage *pending_messages_tail;
- /**
- * @brief Task to destroy this context.
- */
- struct GNUNET_SCHEDULER_Task *destruction_task;
-
/**
* This is pobably followed by 'statistical' data (when we first saw
* it, how did we get its ID, how many pushes (in a timeinterval),
* @brief The peer context associated with the channel
*/
struct PeerContext *peer_ctx;
-
- /**
- * @brief Scheduled task that will destroy this context
- */
- struct GNUNET_SCHEDULER_Task *destruction_task;
};
/**
return ctx;
}
-int
-Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer);
+/**
+ * @brief Check whether we have information about the given peer.
+ *
+ * FIXME probably deprecated. Make this the new _online.
+ *
+ * @param peer peer in question
+ *
+ * @return #GNUNET_YES if peer is known
+ * #GNUNET_NO if peer is not knwon
+ */
+static int
+Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer)
+{
+ if (NULL != peer_map)
+ {
+ return GNUNET_CONTAINER_multipeermap_contains (peer_map, peer);
+ } else
+ {
+ return GNUNET_NO;
+ }
+}
+
/**
* @brief Create a new #PeerContext and insert it into the peer map
return get_peer_ctx (peer);
}
-void
-Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags);
-void
-Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags);
+/**
+ * @brief unset flags on a given peer.
+ *
+ * @param peer the peer to unset flags on
+ * @param flags the flags
+ */
+static void
+Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
+{
+ struct PeerContext *peer_ctx;
+
+ peer_ctx = get_peer_ctx (peer);
+ unset_peer_flag (peer_ctx, flags);
+}
+
+
+/**
+ * @brief set flags on a given peer.
+ *
+ * @param peer the peer to set flags on
+ * @param flags the flags
+ */
+static void
+Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
+{
+ struct PeerContext *peer_ctx;
+
+ peer_ctx = get_peer_ctx (peer);
+ set_peer_flag (peer_ctx, flags);
+}
/**
* @brief Check whether we have a connection to this @a peer
* @return #GNUNET_YES if we are connected
* #GNUNET_NO otherwise
*/
-int
+static int
Peers_check_connected (const struct GNUNET_PeerIdentity *peer)
{
const struct PeerContext *peer_ctx;
* @param cadet_h cadet handle
* @param own_id own peer identity
*/
-void
+static void
Peers_initialise (char* fn_valid_peers,
struct GNUNET_CADET_Handle *cadet_h)
{
* @return the number of key value pairs processed,
* #GNUNET_SYSERR if it aborted iteration
*/
-int
+static int
Peers_get_valid_peers (PeersIterator iterator,
void *it_cls)
{
* @return #GNUNET_YES if peer was inserted
* #GNUNET_NO otherwise
*/
-int
+static int
Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
{
if (GNUNET_YES == Peers_check_peer_known (peer))
return GNUNET_YES;
}
-int
+static int
Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags);
/**
* @return #GNUNET_YES if peer had to be inserted
* #GNUNET_NO otherwise
*/
-int
+static int
Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
{
struct PeerContext *peer_ctx;
* #GNUNET_NO if peer is NOT removable
* #GNUNET_SYSERR if peer is not known
*/
-int
+static int
Peers_check_removable (const struct GNUNET_PeerIdentity *peer)
{
struct PeerContext *peer_ctx;
return GNUNET_YES;
}
-uint32_t *
+static uint32_t *
Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer,
enum Peers_ChannelRole role);
-int
+static int
Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags);
/**
struct PeerContext *peer_ctx = cls;
GNUNET_assert (NULL != peer_ctx);
- peer_ctx->destruction_task = NULL;
Peers_remove_peer (&peer_ctx->peer_id);
}
-static void
-destroy_channel (void *cls);
-
-
/**
- * @brief Schedule the destruction of the given channel.
- *
- * Do so only if it was not already scheduled and not during shutdown.
+ * @brief Callback for scheduler to destroy a channel
*
- * @param channel_ctx The context of the channel to destroy.
+ * @param cls Context of the channel
*/
static void
-schedule_channel_destruction (struct ChannelCtx *channel_ctx)
+destroy_channel (void *cls)
{
- GNUNET_assert (NULL != channel_ctx);
- if (NULL != channel_ctx->destruction_task &&
- GNUNET_NO == in_shutdown)
- {
- channel_ctx->destruction_task =
- GNUNET_SCHEDULER_add_now (&destroy_channel,
- channel_ctx);
- }
-}
+ struct ChannelCtx *channel_ctx = cls;
+ struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
+ GNUNET_assert (channel_ctx == peer_ctx->send_channel_ctx ||
+ channel_ctx == peer_ctx->recv_channel_ctx);
-/**
- * @brief Schedule the destruction of the given peer.
- *
- * Do so only if it was not already scheduled and not during shutdown.
- *
- * @param peer_ctx The context of the peer to destroy.
- */
-static void
-schedule_peer_destruction (struct PeerContext *peer_ctx)
-{
- GNUNET_assert (NULL != peer_ctx);
- if (NULL != peer_ctx->destruction_task &&
- GNUNET_NO == in_shutdown)
- {
- peer_ctx->destruction_task =
- GNUNET_SCHEDULER_add_now (&destroy_peer,
- peer_ctx);
- }
+ GNUNET_CADET_channel_destroy (channel_ctx->channel);
+ remove_channel_ctx (peer_ctx->send_channel_ctx);
}
/* Do we still have to wait for destruction of channels
* or issue the destruction? */
- if (NULL != peer_ctx->send_channel_ctx &&
- NULL != peer_ctx->send_channel_ctx->destruction_task)
- {
- schedule_peer_destruction (peer_ctx);
- return GNUNET_NO;
- }
- if (NULL != peer_ctx->recv_channel_ctx &&
- NULL != peer_ctx->recv_channel_ctx->destruction_task)
+ if (NULL != peer_ctx->send_channel_ctx)
{
- schedule_peer_destruction (peer_ctx);
+ destroy_channel (peer_ctx->send_channel_ctx);
return GNUNET_NO;
}
if (NULL != peer_ctx->recv_channel_ctx)
{
- schedule_channel_destruction (peer_ctx->recv_channel_ctx);
- schedule_peer_destruction (peer_ctx);
- return GNUNET_NO;
- }
- if (NULL != peer_ctx->send_channel_ctx)
- {
- schedule_channel_destruction (peer_ctx->send_channel_ctx);
- schedule_peer_destruction (peer_ctx);
+ destroy_channel (peer_ctx->recv_channel_ctx);
return GNUNET_NO;
}
-
- if (NULL != peer_ctx->destruction_task)
- {
- GNUNET_SCHEDULER_cancel (peer_ctx->destruction_task);
- }
+ destroy_peer (peer_ctx);
if (GNUNET_YES !=
GNUNET_CONTAINER_multipeermap_remove_all (peer_map,
}
-/**
- * @brief set flags on a given peer.
- *
- * @param peer the peer to set flags on
- * @param flags the flags
- */
-void
-Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
-{
- struct PeerContext *peer_ctx;
-
- peer_ctx = get_peer_ctx (peer);
- set_peer_flag (peer_ctx, flags);
-}
-
-
-/**
- * @brief unset flags on a given peer.
- *
- * @param peer the peer to unset flags on
- * @param flags the flags
- */
-void
-Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
-{
- struct PeerContext *peer_ctx;
-
- peer_ctx = get_peer_ctx (peer);
- unset_peer_flag (peer_ctx, flags);
-}
-
-
/**
* @brief Check whether flags on a peer are set.
*
* #GNUNET_YES if all given flags are set
* #GNUNET_NO otherwise
*/
-int
+static int
Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
{
struct PeerContext *peer_ctx;
return check_peer_flag_set (peer_ctx, flags);
}
-/**
- * @brief Check whether we have information about the given peer.
- *
- * FIXME probably deprecated. Make this the new _online.
- *
- * @param peer peer in question
- *
- * @return #GNUNET_YES if peer is known
- * #GNUNET_NO if peer is not knwon
- */
-int
-Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer)
-{
- if (NULL != peer_map)
- {
- return GNUNET_CONTAINER_multipeermap_contains (peer_map, peer);
- } else
- {
- return GNUNET_NO;
- }
-}
-
/**
* @brief Check whether @a peer is actually a peer.
* @return #GNUNET_YES if peer is valid
* #GNUNET_NO if peer is not valid
*/
-int
+static int
Peers_check_peer_valid (const struct GNUNET_PeerIdentity *peer)
{
return GNUNET_CONTAINER_multipeermap_contains (valid_peers, peer);
*
* @param peer the peer to establish channel to
*/
-void
+static void
Peers_indicate_sending_intention (const struct GNUNET_PeerIdentity *peer)
{
GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer));
peer_ctx = get_peer_ctx (peer);
if (NULL != peer_ctx->send_channel_ctx)
{
- schedule_channel_destruction (peer_ctx->send_channel_ctx);
+ destroy_channel (peer_ctx->send_channel_ctx);
(void) Peers_check_connected (peer);
return GNUNET_YES;
}
return GNUNET_NO;
}
-/**
- * @brief Callback for scheduler to destroy a channel
- *
- * @param cls Context of the channel
- */
-static void
-destroy_channel (void *cls)
-{
- struct ChannelCtx *channel_ctx = cls;
- struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
-
- GNUNET_assert (channel_ctx == peer_ctx->send_channel_ctx ||
- channel_ctx == peer_ctx->recv_channel_ctx);
-
- channel_ctx->destruction_task = NULL;
- GNUNET_CADET_channel_destroy (channel_ctx->channel);
- remove_channel_ctx (peer_ctx->send_channel_ctx);
-}
-
-
/**
* @brief Send a message to another peer.
*
CustomPeerMap_remove_peer (push_map, peer);
RPS_sampler_reinitialise_by_value (prot_sampler, peer);
RPS_sampler_reinitialise_by_value (client_sampler, peer);
- schedule_peer_destruction (get_peer_ctx (peer));
+ destroy_peer (get_peer_ctx (peer));
}
{
struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
- if (NULL != channel_ctx->destruction_task)
- {
- GNUNET_SCHEDULER_cancel (channel_ctx->destruction_task);
- }
GNUNET_free (channel_ctx);
if (channel_ctx == peer_ctx->send_channel_ctx)
{
do_round_task = NULL;
}
- Peers_terminate ();
+ peers_terminate ();
GNUNET_NSE_disconnect (nse);
RPS_sampler_destroy (prot_sampler);
p = GNUNET_CONTAINER_multihashmap32_get (c_peer_map->hash_map, *index);
GNUNET_assert (NULL != p);
GNUNET_CONTAINER_multihashmap32_remove_all (c_peer_map->hash_map, *index);
+ // TODO wrong peerid?
GNUNET_CONTAINER_multipeermap_remove_all (c_peer_map->peer_map, peer);
if (*index != CustomPeerMap_size (c_peer_map))
{ /* fill 'gap' with peer at last index */
/* needed bits of the input byte that have not been moved */
char byte_input_leftover;
unsigned num_bits_leftover;
- unsigned num_bits_discard;
+ //unsigned num_bits_discard;
char byte_unaligned_new;
if ( (bits_needed - (i * 8)) <= 8)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "This is the profiler\n");
cur_test_run.name = "test-rps-profiler";
- num_peers = 100;
+ num_peers = 16;
mal_type = 3;
cur_test_run.init_peer = profiler_init_peer;
//cur_test_run.pre_test = mal_pre;
[rps]
#PREFIX = valgrind --leak-check=full --show-leak-kinds=all --log-file=/tmp/rps/valgrind!gnunet-service-rps!%p
+#PREFIX = valgrind --log-file=/tmp/rps/valgrind!gnunet-service-rps!%p
#BINARY = gnunet-service-rps
UNIXPATH = $GNUNET_TMP/gnunet-service-rps.sock
HOME = $SERVICEHOME