diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-17 15:05:15 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-17 15:05:15 +0000 |
commit | bc065008eae3b1254dee33a6211aca4fe944410a (patch) | |
tree | 0b9ecab06d42078b276208a572998e72a6d8d0f8 /src | |
parent | 2bca0645ec82a82749be2d97f27d10ca828760e1 (diff) | |
download | gnunet-bc065008eae3b1254dee33a6211aca4fe944410a.tar.gz gnunet-bc065008eae3b1254dee33a6211aca4fe944410a.zip |
report failed connection attempts in driver, use a queue bigger than 1 in core
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 6 | ||||
-rw-r--r-- | 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, | |||
859 | struct TopologyIteratorContext *topo_ctx = cls; | 859 | struct TopologyIteratorContext *topo_ctx = cls; |
860 | if ((first != NULL) && (second != NULL)) | 860 | if ((first != NULL) && (second != NULL)) |
861 | { | 861 | { |
862 | /* GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "According to CORE, peer %s is connected to %s\n", GNUNET_i2s(first), GNUNET_h2s(&second->hashPubKey));*/ | ||
862 | if ((topo_ctx->peers_seen != NULL) && (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains(topo_ctx->peers_seen, &first->hashPubKey))) | 863 | if ((topo_ctx->peers_seen != NULL) && (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains(topo_ctx->peers_seen, &first->hashPubKey))) |
863 | { | 864 | { |
864 | GNUNET_CONTAINER_multihashmap_put(topo_ctx->peers_seen, &first->hashPubKey, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 865 | GNUNET_CONTAINER_multihashmap_put(topo_ctx->peers_seen, &first->hashPubKey, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
@@ -2351,6 +2352,9 @@ topology_callback (void *cls, | |||
2351 | else | 2352 | else |
2352 | { | 2353 | { |
2353 | failed_connections++; | 2354 | failed_connections++; |
2355 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to connect peer %s to peer %s with error :\n%s\n", | ||
2356 | first_daemon->shortname, | ||
2357 | second_daemon->shortname, emsg); | ||
2354 | #if VERBOSE | 2358 | #if VERBOSE |
2355 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to connect peer %s to peer %s with error :\n%s\n", | 2359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to connect peer %s to peer %s with error :\n%s\n", |
2356 | first_daemon->shortname, | 2360 | first_daemon->shortname, |
@@ -2366,6 +2370,8 @@ topology_callback (void *cls, | |||
2366 | "Created %d total connections, which is our target number! Starting next phase of testing.\n", | 2370 | "Created %d total connections, which is our target number! Starting next phase of testing.\n", |
2367 | total_connections); | 2371 | total_connections); |
2368 | #endif | 2372 | #endif |
2373 | if (failed_connections > 0) | ||
2374 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "While connecting, had %u failed connections.\n", failed_connections); | ||
2369 | if (dhtlog_handle != NULL) | 2375 | if (dhtlog_handle != NULL) |
2370 | { | 2376 | { |
2371 | dhtlog_handle->update_connections (total_connections); | 2377 | 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 @@ | |||
71 | */ | 71 | */ |
72 | #define DEFAULT_BUCKET_SIZE 4 | 72 | #define DEFAULT_BUCKET_SIZE 4 |
73 | 73 | ||
74 | #define DEFAULT_CORE_QUEUE_SIZE 32 | ||
75 | |||
74 | /** | 76 | /** |
75 | * Minimum number of peers we need for "good" routing, | 77 | * Minimum number of peers we need for "good" routing, |
76 | * any less than this and we will allow messages to | 78 | * any less than this and we will allow messages to |
@@ -95,7 +97,7 @@ | |||
95 | /** | 97 | /** |
96 | * How long to keep recent requests around by default. | 98 | * How long to keep recent requests around by default. |
97 | */ | 99 | */ |
98 | #define DEFAULT_RECENT_REMOVAL GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30) | 100 | #define DEFAULT_RECENT_REMOVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) |
99 | 101 | ||
100 | /** | 102 | /** |
101 | * Default time to wait to send find peer messages sent by the dht service. | 103 | * Default time to wait to send find peer messages sent by the dht service. |
@@ -4553,7 +4555,7 @@ run (void *cls, | |||
4553 | GNUNET_SERVER_add_handlers (server, plugin_handlers); | 4555 | GNUNET_SERVER_add_handlers (server, plugin_handlers); |
4554 | GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); | 4556 | GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); |
4555 | coreAPI = GNUNET_CORE_connect (cfg, /* Main configuration */ | 4557 | coreAPI = GNUNET_CORE_connect (cfg, /* Main configuration */ |
4556 | 1, /* queue size */ | 4558 | DEFAULT_CORE_QUEUE_SIZE, /* queue size */ |
4557 | NULL, /* Closure passed to DHT functions */ | 4559 | NULL, /* Closure passed to DHT functions */ |
4558 | &core_init, /* Call core_init once connected */ | 4560 | &core_init, /* Call core_init once connected */ |
4559 | &handle_core_connect, /* Handle connects */ | 4561 | &handle_core_connect, /* Handle connects */ |