From: Martin Schanzenbach Date: Fri, 14 Sep 2012 16:26:33 +0000 (+0000) Subject: -fix X-Git-Tag: initial-import-from-subversion-38251~11800 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b72e803c7a4e5c23d6876a19d138c7a9440ae71b;p=oweals%2Fgnunet.git -fix --- diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 5795b9bea..447581669 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 d879603b4..c32aca84f 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,