diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-04 22:50:32 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:10 +0100 |
commit | 065ecd9a0f92ecafd6c552494a6310b92cc08597 (patch) | |
tree | 0b3ca58f4d2a04278033788063d0b432e90c92aa /src/reclaim/gnunet-service-reclaim.c | |
parent | 73de82ef85076f0421af025887f0053e6c652b09 (diff) | |
download | gnunet-065ecd9a0f92ecafd6c552494a6310b92cc08597.tar.gz gnunet-065ecd9a0f92ecafd6c552494a6310b92cc08597.zip |
bugfixes
Diffstat (limited to 'src/reclaim/gnunet-service-reclaim.c')
-rw-r--r-- | src/reclaim/gnunet-service-reclaim.c | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c index f6fd04eeb..61d029665 100644 --- a/src/reclaim/gnunet-service-reclaim.c +++ b/src/reclaim/gnunet-service-reclaim.c | |||
@@ -1718,31 +1718,26 @@ attr_iter_cb (void *cls, | |||
1718 | struct GNUNET_MQ_Envelope *env; | 1718 | struct GNUNET_MQ_Envelope *env; |
1719 | char *data_tmp; | 1719 | char *data_tmp; |
1720 | 1720 | ||
1721 | if (rd_count == 0) | 1721 | if ((rd_count != 1) || |
1722 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE != rd->record_type)) | ||
1722 | { | 1723 | { |
1723 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); | 1724 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); |
1724 | return; | 1725 | return; |
1725 | } | 1726 | } |
1726 | 1727 | struct AttributeResultMessage *arm; | |
1727 | for (int i = 0; i<rd_count; i++) | 1728 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attribute under: %s\n", |
1728 | { | 1729 | label); |
1729 | if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE != rd[i].record_type) | 1730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1730 | continue; | 1731 | "Sending ATTRIBUTE_RESULT message\n"); |
1731 | struct AttributeResultMessage *arm; | 1732 | env = GNUNET_MQ_msg_extra (arm, |
1732 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attribute under: %s\n", | 1733 | rd->data_size, |
1733 | label); | 1734 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); |
1734 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1735 | arm->id = htonl (ai->request_id); |
1735 | "Sending ATTRIBUTE_RESULT message\n"); | 1736 | arm->attr_len = htons (rd->data_size); |
1736 | env = GNUNET_MQ_msg_extra (arm, | 1737 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); |
1737 | rd[i].data_size, | 1738 | data_tmp = (char *) &arm[1]; |
1738 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); | 1739 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); |
1739 | arm->id = htonl (ai->request_id); | 1740 | GNUNET_MQ_send (ai->client->mq, env); |
1740 | arm->attr_len = htons (rd[i].data_size); | ||
1741 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | ||
1742 | data_tmp = (char *) &arm[1]; | ||
1743 | GNUNET_memcpy (data_tmp, rd[i].data, rd[i].data_size); | ||
1744 | GNUNET_MQ_send (ai->client->mq, env); | ||
1745 | } | ||
1746 | } | 1741 | } |
1747 | 1742 | ||
1748 | 1743 | ||
@@ -1907,31 +1902,27 @@ attest_iter_cb (void *cls, | |||
1907 | struct GNUNET_MQ_Envelope *env; | 1902 | struct GNUNET_MQ_Envelope *env; |
1908 | char *data_tmp; | 1903 | char *data_tmp; |
1909 | 1904 | ||
1910 | if (rd_count == 0) | 1905 | if ((rd_count != 1) || |
1906 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION != rd->record_type)) | ||
1911 | { | 1907 | { |
1912 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); | 1908 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); |
1913 | return; | 1909 | return; |
1914 | } | 1910 | } |
1915 | 1911 | ||
1916 | for (int i = 0; i<rd_count; i++) | 1912 | struct AttestationResultMessage *arm; |
1917 | { | 1913 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", |
1918 | if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION != rd[i].record_type) | 1914 | label); |
1919 | continue; | 1915 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1920 | struct AttestationResultMessage *arm; | 1916 | "Sending ATTESTATION_RESULT message\n"); |
1921 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", | 1917 | env = GNUNET_MQ_msg_extra (arm, |
1922 | label); | 1918 | rd->data_size, |
1923 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1919 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); |
1924 | "Sending ATTESTATION_RESULT message\n"); | 1920 | arm->id = htonl (ai->request_id); |
1925 | env = GNUNET_MQ_msg_extra (arm, | 1921 | arm->attestation_len = htons (rd->data_size); |
1926 | rd[i].data_size, | 1922 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); |
1927 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); | 1923 | data_tmp = (char *) &arm[1]; |
1928 | arm->id = htonl (ai->request_id); | 1924 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); |
1929 | arm->attestation_len = htons (rd[i].data_size); | 1925 | GNUNET_MQ_send (ai->client->mq, env); |
1930 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | ||
1931 | data_tmp = (char *) &arm[1]; | ||
1932 | GNUNET_memcpy (data_tmp, rd[i].data, rd[i].data_size); | ||
1933 | GNUNET_MQ_send (ai->client->mq, env); | ||
1934 | } | ||
1935 | } | 1926 | } |
1936 | 1927 | ||
1937 | 1928 | ||