aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-19 17:15:51 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-19 17:15:51 +0000
commit1b9a6fa6063c79120be8e9cf4bd42863751f04db (patch)
tree0511a203fd1dc0ddb9536a930cb7595e27fa807f /src/fs/fs_api.c
parentb10b45c398e1da19723c368d6ddd3641e2a97a79 (diff)
downloadgnunet-1b9a6fa6063c79120be8e9cf4bd42863751f04db.tar.gz
gnunet-1b9a6fa6063c79120be8e9cf4bd42863751f04db.zip
improving results seen communication to consider which exact keywords a particular result has been seen for so far
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r--src/fs/fs_api.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index f1ba4a5b1..cd854cf5e 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -1793,7 +1793,10 @@ GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr)
1793 || (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->mandatory_missing)) || 1793 || (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->mandatory_missing)) ||
1794 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->optional_support)) || 1794 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->optional_support)) ||
1795 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->availability_success)) || 1795 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->availability_success)) ||
1796 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->availability_trials))) 1796 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, sr->availability_trials)) ||
1797 (GNUNET_OK != GNUNET_BIO_write (wh, sr->keyword_bitmap,
1798 (sr->uri->data.ksk.keywordCount + 7) / 8)) )
1799
1797 { 1800 {
1798 GNUNET_break (0); 1801 GNUNET_break (0);
1799 goto cleanup; 1802 goto cleanup;
@@ -2095,6 +2098,14 @@ deserialize_search_result (void *cls, const char *filename)
2095 GNUNET_break (0); 2098 GNUNET_break (0);
2096 goto cleanup; 2099 goto cleanup;
2097 } 2100 }
2101 sr->keyword_bitmap = GNUNET_malloc ((sr->uri->data.ksk.keywordCount + 7) / 8); /* round up, count bits */
2102 if (GNUNET_OK != GNUNET_BIO_read (rh, "keyword-bitmap",
2103 sr->keyword_bitmap,
2104 (sr->uri->data.ksk.keywordCount + 7) / 8))
2105 {
2106 GNUNET_break (0);
2107 goto cleanup;
2108 }
2098 GNUNET_free (uris); 2109 GNUNET_free (uris);
2099 if (download != NULL) 2110 if (download != NULL)
2100 { 2111 {