diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-09 10:29:25 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-09 10:29:25 +0000 |
commit | 10e40d929862d90d7b1e5e8bd5ce27672b17c7a3 (patch) | |
tree | 9843e4b25e33526880533c2eadba1812f7b00b68 /src/namestore/gnunet-service-namestore.c | |
parent | 5ae9689165089999037632ce82b3bb921d470bb6 (diff) | |
download | gnunet-10e40d929862d90d7b1e5e8bd5ce27672b17c7a3.tar.gz gnunet-10e40d929862d90d7b1e5e8bd5ce27672b17c7a3.zip |
- fix
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 749fb30d9..727471f06 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -298,6 +298,7 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client) | |||
298 | GNUNET_SERVER_client_drop(nc->client); | 298 | GNUNET_SERVER_client_drop(nc->client); |
299 | GNUNET_CONTAINER_DLL_remove (client_head, client_tail, nc); | 299 | GNUNET_CONTAINER_DLL_remove (client_head, client_tail, nc); |
300 | GNUNET_free (nc); | 300 | GNUNET_free (nc); |
301 | nc = NULL; | ||
301 | } | 302 | } |
302 | 303 | ||
303 | 304 | ||
@@ -434,8 +435,9 @@ handle_lookup_name_it (void *cls, | |||
434 | if (GNUNET_CONTAINER_multihashmap_contains(zonekeys, &zone_key_hash)) | 435 | if (GNUNET_CONTAINER_multihashmap_contains(zonekeys, &zone_key_hash)) |
435 | { | 436 | { |
436 | cc = GNUNET_CONTAINER_multihashmap_get(zonekeys, &zone_key_hash); | 437 | cc = GNUNET_CONTAINER_multihashmap_get(zonekeys, &zone_key_hash); |
437 | signature_new = GNUNET_NAMESTORE_create_signature(cc->privkey, name, rd_selected, copied_elements); | 438 | signature_new = GNUNET_NAMESTORE_create_signature(cc->privkey, name, rd, rd_count); |
438 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating signature for name `%s' in zone `%s'\n",name, GNUNET_h2s(&zone_key_hash)); | 439 | GNUNET_assert (signature_new != NULL); |
440 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating signature for name `%s' with %u records in zone `%s'\n",name, copied_elements, GNUNET_h2s(&zone_key_hash)); | ||
439 | authoritative = GNUNET_YES; | 441 | authoritative = GNUNET_YES; |
440 | } | 442 | } |
441 | else | 443 | else |
@@ -466,19 +468,24 @@ handle_lookup_name_it (void *cls, | |||
466 | memset(&lnr_msg->public_key, '\0', sizeof (lnr_msg->public_key)); | 468 | memset(&lnr_msg->public_key, '\0', sizeof (lnr_msg->public_key)); |
467 | 469 | ||
468 | if (GNUNET_YES == authoritative) | 470 | if (GNUNET_YES == authoritative) |
469 | { | 471 | { /* use new created signature */ |
470 | lnr_msg->contains_sig = htons (GNUNET_YES); | 472 | lnr_msg->contains_sig = htons (GNUNET_YES); |
473 | GNUNET_assert (signature_new != NULL); | ||
471 | lnr_msg->signature = *signature_new; | 474 | lnr_msg->signature = *signature_new; |
472 | GNUNET_free (signature_new); | 475 | GNUNET_free (signature_new); |
473 | } | 476 | } |
474 | if (GNUNET_YES == contains_signature) | 477 | else if (GNUNET_YES == contains_signature) |
475 | { | 478 | { |
479 | /* use existing signature */ | ||
476 | lnr_msg->contains_sig = htons (GNUNET_YES); | 480 | lnr_msg->contains_sig = htons (GNUNET_YES); |
481 | GNUNET_assert (signature != NULL); | ||
477 | lnr_msg->signature = *signature; | 482 | lnr_msg->signature = *signature; |
478 | } | 483 | } |
479 | else | 484 | else |
485 | { | ||
486 | /* use no signature */ | ||
480 | memset (&lnr_msg->signature, '\0', sizeof (lnr_msg->signature)); | 487 | memset (&lnr_msg->signature, '\0', sizeof (lnr_msg->signature)); |
481 | 488 | } | |
482 | 489 | ||
483 | name_tmp = (char *) &lnr_msg[1]; | 490 | name_tmp = (char *) &lnr_msg[1]; |
484 | rd_tmp = &name_tmp[name_len]; | 491 | rd_tmp = &name_tmp[name_len]; |
@@ -721,7 +728,7 @@ handle_create_record_it (void *cls, | |||
721 | } | 728 | } |
722 | 729 | ||
723 | if (exist == GNUNET_SYSERR) | 730 | if (exist == GNUNET_SYSERR) |
724 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "NO existing records for `%s' to update!\n", crc->name); | 731 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "New record does not exist for name `%s'!\n", crc->name); |
725 | 732 | ||
726 | if (exist == GNUNET_SYSERR) | 733 | if (exist == GNUNET_SYSERR) |
727 | { | 734 | { |