report failed connection attempts in driver, use a queue bigger than 1 in core
authorNathan S. Evans <evans@in.tum.de>
Wed, 17 Nov 2010 15:05:15 +0000 (15:05 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 17 Nov 2010 15:05:15 +0000 (15:05 +0000)
src/dht/gnunet-dht-driver.c
src/dht/gnunet-service-dht.c

index d3ab1902cde5e43411c9a381f394a3095370ab88..da51193a0ddc310bd3642deeeb20351af813fc4d 100644 (file)
@@ -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);
index 7e6c20559984e225af6b2016bb2428dc62e5a2a0..2e27ba55b4b56875d535bcf1f563b79b60a18009 100644 (file)
@@ -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 */