aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-19 21:00:48 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-19 21:00:48 +0000
commitee1e3f6aa111940f28c4f75f5a4b0a3a0d2c4527 (patch)
tree70f4821404eb7b95678694aaf93e636c3a332a25 /src/fs/fs_api.c
parent0e16e2c10f6790bd231a7090212f6f856577418c (diff)
downloadgnunet-ee1e3f6aa111940f28c4f75f5a4b0a3a0d2c4527.tar.gz
gnunet-ee1e3f6aa111940f28c4f75f5a4b0a3a0d2c4527.zip
-not all uris are ksks
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r--src/fs/fs_api.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 075bedc21..293638732 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -1793,10 +1793,15 @@ 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, 1797 {
1798 (sr->uri == NULL) ? 0 : (sr->uri->data.ksk.keywordCount + 7) / 8)) ) 1798 GNUNET_break (0);
1799 1799 goto cleanup;
1800 }
1801 if ( (sr->uri != NULL) &&
1802 (sr->uri->type == ksk) &&
1803 (GNUNET_OK != GNUNET_BIO_write (wh, sr->keyword_bitmap,
1804 (sr->uri->data.ksk.keywordCount + 7) / 8)) )
1800 { 1805 {
1801 GNUNET_break (0); 1806 GNUNET_break (0);
1802 goto cleanup; 1807 goto cleanup;
@@ -2098,13 +2103,17 @@ deserialize_search_result (void *cls, const char *filename)
2098 GNUNET_break (0); 2103 GNUNET_break (0);
2099 goto cleanup; 2104 goto cleanup;
2100 } 2105 }
2101 sr->keyword_bitmap = GNUNET_malloc ((sr->uri->data.ksk.keywordCount + 7) / 8); /* round up, count bits */ 2106 if ( (NULL != sr->uri) &&
2102 if (GNUNET_OK != GNUNET_BIO_read (rh, "keyword-bitmap", 2107 (sr->uri->type == ksk) )
2103 sr->keyword_bitmap,
2104 (sr->uri == NULL) ? 0 : (sr->uri->data.ksk.keywordCount + 7) / 8))
2105 { 2108 {
2106 GNUNET_break (0); 2109 sr->keyword_bitmap = GNUNET_malloc ((sr->uri->data.ksk.keywordCount + 7) / 8); /* round up, count bits */
2107 goto cleanup; 2110 if (GNUNET_OK != GNUNET_BIO_read (rh, "keyword-bitmap",
2111 sr->keyword_bitmap,
2112 (sr->uri->data.ksk.keywordCount + 7) / 8))
2113 {
2114 GNUNET_break (0);
2115 goto cleanup;
2116 }
2108 } 2117 }
2109 GNUNET_free (uris); 2118 GNUNET_free (uris);
2110 if (download != NULL) 2119 if (download != NULL)