gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r23555 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r23555 - gnunet/src/dht
Date: Sun, 2 Sep 2012 14:51:26 +0200

Author: grothoff
Date: 2012-09-02 14:51:26 +0200 (Sun, 02 Sep 2012)
New Revision: 23555

Modified:
   gnunet/src/dht/dht.conf.in
   gnunet/src/dht/gnunet-service-dht_neighbours.c
Log:
adding DHT option to disable calls to try connect

Modified: gnunet/src/dht/dht.conf.in
===================================================================
--- gnunet/src/dht/dht.conf.in  2012-09-02 11:17:10 UTC (rev 23554)
+++ gnunet/src/dht/dht.conf.in  2012-09-02 12:51:26 UTC (rev 23555)
@@ -11,7 +11,7 @@
 UNIXPATH = /tmp/gnunet-service-dht.sock
 # This could be relaxed...
 UNIX_MATCH_UID = YES
-UNIX_MATCH_GID = YES
+UNIX_MATCH_GID = YESa
 # DISABLE_SOCKET_FORWARDING = NO
 # DEBUG = YES
 # USERNAME = 
@@ -32,7 +32,10 @@
 # STOP_FOUND =
 # CONVERGE_MODIFIER =
 
+# Special option to disable DHT calling 'try_connect' (for testing)
+DISABLE_TRY_CONNECT = NO
 
+
 [dhtcache]
 DATABASE = sqlite
 QUOTA = 1 MB

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2012-09-02 11:17:10 UTC 
(rev 23554)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2012-09-02 12:51:26 UTC 
(rev 23555)
@@ -384,6 +384,11 @@
 static unsigned int newly_found_peers;
 
 /**
+ * Option for testing that disables the 'connect' function of the DHT.
+ */
+static int disable_try_connect;
+
+/**
  * The buckets.  Array of size MAX_BUCKET_SIZE.  Offset 0 means 0 bits 
matching.
  */
 static struct PeerBucket k_buckets[MAX_BUCKETS];
@@ -1941,7 +1946,9 @@
         if (NULL != GDS_transport_handle)
         {
           GNUNET_TRANSPORT_offer_hello (GDS_transport_handle, h, NULL, NULL);
-          GNUNET_TRANSPORT_try_connect (GDS_transport_handle, &pid);
+         if (GNUNET_YES !=
+             disable_try_connect)
+           GNUNET_TRANSPORT_try_connect (GDS_transport_handle, &pid);
         }
       }
     }
@@ -1998,6 +2005,8 @@
   };
   unsigned long long temp_config_num;
 
+  disable_try_connect
+    = GNUNET_CONFIGURATION_get_value_yesno (GDS_cfg, "DHT", 
"DISABLE_TRY_CONNECT");
   if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_number (GDS_cfg, "DHT", "bucket_size",
                                              &temp_config_num))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]