diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-06-25 15:13:03 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-06-25 15:13:03 +0000 |
commit | f57b66b0a8bd21a7c0ad1baeb867d0021f48589f (patch) | |
tree | 9b783b774caf869ce580f140e7fe1f1bcac21b3e | |
parent | d8e10eda1f8dcf1bd81847b0e7bac188ddd357d8 (diff) |
mesh bug for bart
-rw-r--r-- | src/set/gnunet-service-set.c | 5 | ||||
-rw-r--r-- | src/set/gnunet-service-set.h | 24 | ||||
-rw-r--r-- | src/set/gnunet-set-profiler.c | 31 |
3 files changed, 32 insertions, 28 deletions
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c index d0916d89c6..644626dd01 100644 --- a/src/set/gnunet-service-set.c +++ b/src/set/gnunet-service-set.c @@ -665,7 +665,7 @@ incoming_timeout_cb (void *cls, { struct Incoming *incoming = cls; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "remote peer timed out"); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "remote peer timed out\n"); incoming_destroy (incoming); } @@ -712,8 +712,7 @@ tunnel_new_cb (void *cls, /** * Function called whenever a tunnel is destroyed. Should clean up - * any associated state. This function is NOT called if the client has - * explicitly asked for the tunnel to be destroyed using + * any associated state. * GNUNET_MESH_tunnel_destroy. It must NOT call GNUNET_MESH_tunnel_destroy on * the tunnel. * diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h index 6f0af0716b..937bc9adcd 100644 --- a/src/set/gnunet-service-set.h +++ b/src/set/gnunet-service-set.h @@ -200,12 +200,36 @@ enum TunnelContextType { CONTEXT_OPERATION_INTERSECTION, }; +/** + * Information about a tunnel we are connected to. + * Used as tunnel context with mesh. + */ struct TunnelContext { + /** + * The mesh tunnel that has this context + */ struct GNUNET_MESH_Tunnel *tunnel; + + /** + * The peer on the other side. + */ struct GNUNET_PeerIdentity peer; + + /** + * Handle to the message queue for the tunnel. + */ struct GNUNET_MQ_Handle *mq; + + /** + * Type of the tunnel. + */ enum TunnelContextType type; + + /** + * State associated with the tunnel, dependent on + * tunnel type. + */ void *data; }; diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c index bbaef7c43f..0a2c2779b1 100644 --- a/src/set/gnunet-set-profiler.c +++ b/src/set/gnunet-set-profiler.c @@ -183,18 +183,9 @@ set_insert_iterator (void *cls, } -/** - * Signature of the 'main' function for a (single-peer) testcase that - * is run using 'GNUNET_TESTING_peer_run'. - * - * @param cls closure - * @param cfg configuration of the peer that was started - * @param peer identity of the peer that was created - */ static void -test_main (void *cls, - const struct GNUNET_CONFIGURATION_Handle *cfg, - struct GNUNET_TESTING_Peer *peer) +run (void *cls, char *const *args, const char *cfgfile, + const struct GNUNET_CONFIGURATION_Handle *cfg) { unsigned int i; struct GNUNET_HashCode hash; @@ -283,16 +274,6 @@ test_main (void *cls, GNUNET_SET_commit (set_oh1, set_a); } -static void -run (void *cls, char *const *args, const char *cfgfile, - const struct GNUNET_CONFIGURATION_Handle *cfg) -{ - - ret = GNUNET_TESTING_peer_run ("test_set_api", - "test_set.conf", - &test_main, NULL); -} - int main (int argc, char **argv) @@ -304,7 +285,7 @@ main (int argc, char **argv) { 'B', "num-second", NULL, gettext_noop ("number of values"), GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_b }, - { 'B', "num-common", NULL, + { 'C', "num-common", NULL, gettext_noop ("number of values"), GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_c }, { 'x', "operation", NULL, @@ -312,9 +293,9 @@ main (int argc, char **argv) GNUNET_YES, &GNUNET_GETOPT_set_string, &op_str }, GNUNET_GETOPT_OPTION_END }; - GNUNET_PROGRAM_run2 (argc, argv, "gnunet-consensus", - "help", - options, &run, NULL, GNUNET_YES); + GNUNET_PROGRAM_run (argc, argv, "gnunet-set-profiler", + "help", + options, &run, NULL); return ret; } |