From bc065008eae3b1254dee33a6211aca4fe944410a Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Wed, 17 Nov 2010 15:05:15 +0000 Subject: [PATCH] report failed connection attempts in driver, use a queue bigger than 1 in core --- src/dht/gnunet-dht-driver.c | 6 ++++++ src/dht/gnunet-service-dht.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index d3ab1902c..da51193a0 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c @@ -859,6 +859,7 @@ log_topology_cb (void *cls, struct TopologyIteratorContext *topo_ctx = cls; if ((first != NULL) && (second != NULL)) { + /* GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "According to CORE, peer %s is connected to %s\n", GNUNET_i2s(first), GNUNET_h2s(&second->hashPubKey));*/ if ((topo_ctx->peers_seen != NULL) && (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains(topo_ctx->peers_seen, &first->hashPubKey))) { GNUNET_CONTAINER_multihashmap_put(topo_ctx->peers_seen, &first->hashPubKey, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); @@ -2351,6 +2352,9 @@ topology_callback (void *cls, else { failed_connections++; + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to connect peer %s to peer %s with error :\n%s\n", + first_daemon->shortname, + second_daemon->shortname, emsg); #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to connect peer %s to peer %s with error :\n%s\n", first_daemon->shortname, @@ -2366,6 +2370,8 @@ topology_callback (void *cls, "Created %d total connections, which is our target number! Starting next phase of testing.\n", total_connections); #endif + if (failed_connections > 0) + GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "While connecting, had %u failed connections.\n", failed_connections); if (dhtlog_handle != NULL) { dhtlog_handle->update_connections (total_connections); diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 7e6c20559..2e27ba55b 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -71,6 +71,8 @@ */ #define DEFAULT_BUCKET_SIZE 4 +#define DEFAULT_CORE_QUEUE_SIZE 32 + /** * Minimum number of peers we need for "good" routing, * any less than this and we will allow messages to @@ -95,7 +97,7 @@ /** * How long to keep recent requests around by default. */ -#define DEFAULT_RECENT_REMOVAL GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30) +#define DEFAULT_RECENT_REMOVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) /** * Default time to wait to send find peer messages sent by the dht service. @@ -4553,7 +4555,7 @@ run (void *cls, GNUNET_SERVER_add_handlers (server, plugin_handlers); GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); coreAPI = GNUNET_CORE_connect (cfg, /* Main configuration */ - 1, /* queue size */ + DEFAULT_CORE_QUEUE_SIZE, /* queue size */ NULL, /* Closure passed to DHT functions */ &core_init, /* Call core_init once connected */ &handle_core_connect, /* Handle connects */ -- 2.25.1