aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschanzen <schanzen@140774ce-b5e7-0310-ab8b-a85725594a96>2012-09-14 16:26:33 +0000
committerschanzen <schanzen@140774ce-b5e7-0310-ab8b-a85725594a96>2012-09-14 16:26:33 +0000
commitc6d91ebcadccf38ad1e938d6e20ebcf7e094d9df (patch)
tree7acea14404a20c769b18443ec6e0bc06fe43b94a
parent931afc1cf79b97abf5aa0cd5b416ec7bac20686f (diff)
-fix
git-svn-id: https://gnunet.org/svn/gnunet@23821 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r--src/gns/gnunet-service-gns.c7
-rw-r--r--src/gns/gnunet-service-gns_resolver.c21
2 files changed, 19 insertions, 9 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c
index 5795b9beac..447581669b 100644
--- a/src/gns/gnunet-service-gns.c
+++ b/src/gns/gnunet-service-gns.c
@@ -842,12 +842,13 @@ static void handle_shorten (void *cls,
GNUNET_CONTAINER_DLL_insert (csh_head, csh_tail, csh);
GNUNET_STRINGS_utf8_tolower((char*)&sh_msg[1], &nameptr);
-
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "SHORTEN: Converted %s to %s\n", (char*)&sh_msg[1], nameptr);
GNUNET_SERVER_notification_context_add (nc, client);
if (strlen (name) < strlen(GNUNET_GNS_TLD)) {
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
- "SHORTEN: %s is too short", name);
+ "SHORTEN: %s is too short\n", name);
GNUNET_CONTAINER_DLL_remove (csh_head, csh_tail, csh);
send_shorten_response(csh, name);
return;
@@ -855,7 +856,7 @@ static void handle_shorten (void *cls,
if (strlen (name) > MAX_DNS_NAME_LENGTH) {
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
- "SHORTEN: %s is too long", name);
+ "SHORTEN: %s is too long\n", name);
GNUNET_CONTAINER_DLL_remove (csh_head, csh_tail, csh);
send_shorten_response(csh, name);
return;
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index d879603b4c..c32aca84f8 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -3690,8 +3690,11 @@ process_zone_to_name_shorten_shorten (void *cls,
}
next_authority = rh->authority_chain_head;
- GNUNET_snprintf(tmp_name, MAX_DNS_NAME_LENGTH,
- "%s.%s", rh->name, next_authority->name);
+ if (0 == strcmp (rh->name, ""))
+ strcpy (tmp_name, next_authority->name);
+ else
+ GNUNET_snprintf(tmp_name, MAX_DNS_NAME_LENGTH,
+ "%s.%s", rh->name, next_authority->name);
strcpy(rh->name, tmp_name);
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
@@ -3800,8 +3803,11 @@ process_zone_to_name_shorten_private (void *cls,
}
next_authority = rh->authority_chain_head;
- GNUNET_snprintf(tmp_name, MAX_DNS_NAME_LENGTH,
- "%s.%s", rh->name, next_authority->name);
+ if (0 == strcmp (rh->name, ""))
+ strcpy (tmp_name, next_authority->name);
+ else
+ GNUNET_snprintf(tmp_name, MAX_DNS_NAME_LENGTH,
+ "%s.%s", rh->name, next_authority->name);
strcpy(rh->name, tmp_name);
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
@@ -3919,8 +3925,11 @@ process_zone_to_name_shorten_root (void *cls,
}
next_authority = rh->authority_chain_head;
- GNUNET_snprintf(tmp_name, MAX_DNS_NAME_LENGTH,
- "%s.%s", rh->name, next_authority->name);
+ if (0 == strcmp (rh->name, ""))
+ strcpy (tmp_name, next_authority->name);
+ else
+ GNUNET_snprintf(tmp_name, MAX_DNS_NAME_LENGTH,
+ "%s.%s", rh->name, next_authority->name);
strcpy(rh->name, tmp_name);
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,