[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20649 - gnunet/src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20649 - gnunet/src/gns |
Date: |
Wed, 21 Mar 2012 14:47:51 +0100 |
Author: schanzen
Date: 2012-03-21 14:47:51 +0100 (Wed, 21 Mar 2012)
New Revision: 20649
Modified:
gnunet/src/gns/gnunet-service-gns.c
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/gns/test_gns_dht_delegated_lookup.c
gnunet/src/gns/test_gns_simple_lookup.conf
Log:
-fixes, auto_import_pkey imlpl
Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2012-03-21 13:33:51 UTC (rev 20648)
+++ gnunet/src/gns/gnunet-service-gns.c 2012-03-21 13:47:51 UTC (rev 20649)
@@ -152,6 +152,9 @@
/* zone update task */
GNUNET_SCHEDULER_TaskIdentifier zone_update_taskid = GNUNET_SCHEDULER_NO_TASK;
+/* automatic pkey import for name shortening */
+static int auto_import_pkey;
+
/**
* Task run during shutdown.
*
@@ -716,9 +719,18 @@
clh->unique_id = sh_msg->id;
clh->type = ntohl(sh_msg->type);
- gns_resolver_lookup_record(zone_hash, clh->type, name,
- zone_key,
- &send_lookup_response, clh);
+ if (GNUNET_YES == auto_import_pkey)
+ {
+ gns_resolver_lookup_record(zone_hash, clh->type, name,
+ zone_key,
+ &send_lookup_response, clh);
+ }
+ else
+ {
+ gns_resolver_lookup_record(zone_hash, clh->type, name,
+ NULL,
+ &send_lookup_response, clh);
+ }
}
@@ -790,8 +802,19 @@
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not connect to DHT!\n");
}
- if (gns_resolver_init(namestore_handle, dht_handle) == GNUNET_SYSERR)
+ if (GNUNET_YES ==
+ GNUNET_CONFIGURATION_get_value_yesno (c, "gns",
+ "AUTO_IMPORT_PKEY"))
{
+ GNUNET_log(GNUNET_ERROR_TYPE_INFO,
+ "Automatic PKEY import is enabled.\n");
+ auto_import_pkey = GNUNET_YES;
+
+ }
+
+ if (gns_resolver_init(namestore_handle, dht_handle)
+ == GNUNET_SYSERR)
+ {
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
"Unable to initialize resolver!\n");
GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -811,7 +834,7 @@
"Failed to enable the dns interceptor!\n");
}
}
-
+
//put_some_records(); //FIXME for testing
/**
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2012-03-21 13:33:51 UTC
(rev 20648)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2012-03-21 13:47:51 UTC
(rev 20649)
@@ -337,9 +337,10 @@
* @param zone the authority
* @param the private key of our authority
*/
-static void process_discovered_authority(char* name, struct
GNUNET_CRYPTO_ShortHashCode zone,
- struct GNUNET_CRYPTO_ShortHashCode
our_zone,
- struct GNUNET_CRYPTO_RsaPrivateKey *key)
+static void process_discovered_authority(char* name,
+ struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode
our_zone,
+ struct GNUNET_CRYPTO_RsaPrivateKey *key)
{
struct GetPseuAuthorityHandle *gph;
size_t namelen;
@@ -878,7 +879,7 @@
rh->authority_chain_tail,
auth);
- /** call process new authority */
+ /** try to import pkey if private key available */
if (rh->priv_key)
process_discovered_authority(name, auth->zone,
rh->authority_chain_tail->zone,
Modified: gnunet/src/gns/test_gns_dht_delegated_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_dht_delegated_lookup.c 2012-03-21 13:33:51 UTC
(rev 20648)
+++ gnunet/src/gns/test_gns_dht_delegated_lookup.c 2012-03-21 13:47:51 UTC
(rev 20649)
@@ -18,23 +18,9 @@
Boston, MA 02111-1307, USA.
*/
/**
- * @file gns/test_gns_twopeer.c
- * @brief base testcase for testing DHT service with
- * two running peers.
+ * @file gns/test_gns_dht_delegated_lookup.c
+ * @brief test for record lookup via DHT
*
- * This testcase starts peers using the GNUNET_TESTING_daemons_start
- * function call. On peer start, connects to the peers DHT service
- * by calling GNUNET_DHT_connected. Once notified about all peers
- * being started (by the peers_started_callback function), calls
- * GNUNET_TESTING_connect_topology, which connects the peers in a
- * "straight line" topology. On notification that all peers have
- * been properly connected, calls the do_get function which initiates
- * a GNUNET_DHT_get from the *second* peer. Once the GNUNET_DHT_get
- * function starts, runs the do_put function to insert data at the first peer.
- * If the GET is successful, schedules finish_testing
- * to stop the test and shut down peers. If GET is unsuccessful
- * after GET_TIMEOUT seconds, prints an error message and shuts down
- * the peers.
*/
#include "platform.h"
#include "gnunet_testing_lib.h"
Modified: gnunet/src/gns/test_gns_simple_lookup.conf
===================================================================
--- gnunet/src/gns/test_gns_simple_lookup.conf 2012-03-21 13:33:51 UTC (rev
20648)
+++ gnunet/src/gns/test_gns_simple_lookup.conf 2012-03-21 13:47:51 UTC (rev
20649)
@@ -79,9 +79,9 @@
UNIXPATH = /tmp/gnunet-service-gns.sock
HOME = $SERVICEHOME
CONFIG = $DEFAULTCONFIG
+AUTO_IMPORT_PKEY = YES
-
[nse]
AUTOSTART = NO
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20649 - gnunet/src/gns,
gnunet <=