[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21372 - gnunet/src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21372 - gnunet/src/gns |
Date: |
Wed, 9 May 2012 13:25:44 +0200 |
Author: schanzen
Date: 2012-05-09 13:25:44 +0200 (Wed, 09 May 2012)
New Revision: 21372
Modified:
gnunet/src/gns/gnunet-service-gns.c
gnunet/src/gns/gnunet-service-gns_interceptor.c
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/gns/gnunet-service-gns_resolver.h
Log:
-fixes
Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2012-05-09 11:07:47 UTC (rev 21371)
+++ gnunet/src/gns/gnunet-service-gns.c 2012-05-09 11:25:44 UTC (rev 21372)
@@ -605,11 +605,11 @@
key = lookup_private_key(&sh_msg->zone);
csh->zone_key = key;
}
- gns_resolver_shorten_name(zone, name, key,
+ gns_resolver_shorten_name(zone, zone, name, key,
&send_shorten_response, csh);
}
else
- gns_resolver_shorten_name(zone, name, NULL,
+ gns_resolver_shorten_name(zone, zone, name, NULL,
&send_shorten_response, csh);
}
@@ -751,7 +751,7 @@
strlen(name)-strlen(GNUNET_GNS_TLD));
/* Start delegation resolution in our namestore */
- gns_resolver_get_authority(zone_hash, name, &send_get_auth_response, cah);
+ gns_resolver_get_authority(zone_hash, zone_hash, name,
&send_get_auth_response, cah);
}
@@ -878,14 +878,14 @@
clh->zone_key = key;
}
- gns_resolver_lookup_record(zone, clh->type, name,
+ gns_resolver_lookup_record(zone, zone, clh->type, name,
key,
default_lookup_timeout,
&send_lookup_response, clh);
}
else
{
- gns_resolver_lookup_record(zone, clh->type, name,
+ gns_resolver_lookup_record(zone, zone, clh->type, name,
NULL,
default_lookup_timeout,
&send_lookup_response, clh);
Modified: gnunet/src/gns/gnunet-service-gns_interceptor.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_interceptor.c 2012-05-09 11:07:47 UTC
(rev 21371)
+++ gnunet/src/gns/gnunet-service-gns_interceptor.c 2012-05-09 11:25:44 UTC
(rev 21372)
@@ -243,7 +243,7 @@
ilh->request_handle = request;
/* Start resolution in our zone */
- gns_resolver_lookup_record(our_zone, q->type, q->name,
+ gns_resolver_lookup_record(our_zone, our_zone, q->type, q->name,
our_key,
default_lookup_timeout,
&reply_to_dns, ilh);
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2012-05-09 11:07:47 UTC
(rev 21371)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2012-05-09 11:25:44 UTC
(rev 21372)
@@ -634,6 +634,7 @@
rh->id, new_name, rlh->record_type);
gns_resolver_lookup_record(rh->authority,
+ rh->private_local_zone,
rlh->record_type,
new_name,
rh->priv_key,
@@ -1081,6 +1082,7 @@
rh->id, rh->name, rlh->record_type);
gns_resolver_lookup_record(rh->authority,
+ rh->private_local_zone,
rlh->record_type,
new_name,
rh->priv_key,
@@ -1507,7 +1509,7 @@
*/
if (rh->status & (RSL_RECORD_EXPIRED | !RSL_RECORD_EXISTS) &&
GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone) &&
+ &rh->private_local_zone) &&
(strcmp(rh->name, "+") == 0))
{
rh->proc = &handle_record_dht;
@@ -1800,7 +1802,7 @@
**/
if (((rh->status & RSL_RECORD_EXISTS) && (!(rh->status &
RSL_RECORD_EXPIRED)))
|| !GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone))
+ &rh->private_local_zone))
{
if (is_canonical(rh->name))
{
@@ -2056,6 +2058,7 @@
* calls lookup result processor on result
*
* @param zone the root zone
+ * @param pzone the private local zone
* @param record_type the record type to look up
* @param name the name to look up
* @param key a private key for use with PSEU import (can be NULL)
@@ -2065,6 +2068,7 @@
*/
void
gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
uint32_t record_type,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
@@ -2100,6 +2104,8 @@
rh->priv_key = key;
rh->timeout = timeout;
rh->get_handle = NULL;
+ rh->private_local_zone = pzone;
+
if (timeout.rel_value != GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
{
/*
@@ -2255,7 +2261,7 @@
free_resolver_handle(rh);
}
else if (GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone) == 0)
+ &rh->private_local_zone) == 0)
{
/* our zone, just append .gnunet */
answer_len = strlen(rh->name) + strlen(GNUNET_GNS_TLD) + 2;
@@ -2353,7 +2359,7 @@
"PKEY resolved as far as possible in ns up to %s!\n", rh->name);
if (GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone) == 0)
+ &rh->private_local_zone) == 0)
{
/**
* This is our zone append .gnunet unless name is empty
@@ -2498,6 +2504,7 @@
* Shorten api from resolver
*
* @param zone the zone to use
+ * @param pzone the private local zone
* @param name the name to shorten
* @param key optional private key for background lookups and PSEU import
* @param proc the processor to call with result
@@ -2505,6 +2512,7 @@
*/
void
gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
ShortenResultProcessor proc,
@@ -2541,6 +2549,7 @@
rh->proc = &handle_delegation_ns_shorten;
rh->proc_cls = nsh;
rh->id = rid++;
+ rh->private_local_zone = pzone;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Checking for TLD...\n");
@@ -2686,12 +2695,14 @@
* in our namestore
*
* @param zone the root zone to look up for
+ * @param pzone the private local zone
* @param name the name to lookup up
* @param proc the processor to call when finished
* @param proc_cls the closure to pass to the processor
*/
void
gns_resolver_get_authority(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
GetAuthorityResultProcessor proc,
void* proc_cls)
@@ -2706,6 +2717,7 @@
rh = GNUNET_malloc(sizeof (struct ResolverHandle));
rh->authority = zone;
rh->id = rid++;
+ rh->private_local_zone = pzone;
if (strcmp(GNUNET_GNS_TLD, name) == 0)
{
Modified: gnunet/src/gns/gnunet-service-gns_resolver.h
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.h 2012-05-09 11:07:47 UTC
(rev 21371)
+++ gnunet/src/gns/gnunet-service-gns_resolver.h 2012-05-09 11:25:44 UTC
(rev 21372)
@@ -150,6 +150,9 @@
/* status of the resolution result */
enum ResolutionStatus status;
+ /* The provate local zone of this request */
+ struct GNUNET_CRYPTO_ShortHashCode private_local_zone;
+
/**
* private key of an/our authoritative zone
* can be NULL but automatical PKEY import will not work
@@ -276,6 +279,7 @@
* calls RecordLookupProcessor on result or timeout
*
* @param zone the root zone
+ * @param pzone the private local zone
* @param record_type the record type to look up
* @param name the name to look up
* @param key optional private key for authority caching
@@ -285,6 +289,7 @@
*/
void
gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
uint32_t record_type,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
@@ -300,6 +305,7 @@
* actually be canonical/short etc.
*
* @param zone the zone to perform the operation in
+ * @param pzone the private local zone
* @param name name to shorten
* @param key optional private key for background lookups and PSEU import
* @param proc the processor to call on shorten result
@@ -307,6 +313,7 @@
*/
void
gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
ShortenResultProcessor proc,
@@ -317,12 +324,14 @@
* in our namestore
*
* @param zone the root zone to look up for
+ * @param pzone the private local zone
* @param name the name to lookup up
* @param proc the processor to call when finished
* @param proc_cls the closure to pass to the processor
*/
void
gns_resolver_get_authority(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
GetAuthorityResultProcessor proc,
void* proc_cls);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21372 - gnunet/src/gns,
gnunet <=