{
struct GNUNET_CONTAINER_MultiHashMap *mcm = cls;
struct KeywordCounter *cnt;
- GNUNET_HashCode hc;
+ struct GNUNET_HashCode hc;
size_t klen;
klen = strlen (keyword) + 1;
const char *data_mime_type, const char *data, size_t data_len)
{
struct GNUNET_CONTAINER_MultiHashMap *map = cls;
- GNUNET_HashCode key;
+ struct GNUNET_HashCode key;
struct MetaCounter *cnt;
GNUNET_CRYPTO_hash (data, data_len, &key);
{
struct TrimContext *tc = cls;
struct KeywordCounter *counter;
- GNUNET_HashCode hc;
+ struct GNUNET_HashCode hc;
size_t klen;
klen = strlen (keyword) + 1;
* @return GNUNET_YES (always)
*/
static int
-migrate_and_drop_keywords (void *cls, const GNUNET_HashCode * key, void *value)
+migrate_and_drop_keywords (void *cls, const struct GNUNET_HashCode * key, void *value)
{
struct TrimContext *tc = cls;
struct KeywordCounter *counter = value;
* @return GNUNET_YES (always)
*/
static int
-migrate_and_drop_metadata (void *cls, const GNUNET_HashCode * key, void *value)
+migrate_and_drop_metadata (void *cls, const struct GNUNET_HashCode * key, void *value)
{
struct TrimContext *tc = cls;
struct MetaCounter *counter = value;
}
/* consider adding filename to directory meta data */
- if (tree->is_directory)
+ if (tree->is_directory == GNUNET_YES)
{
const char *user = getenv ("USER");
if ( (user == NULL) ||
{
tc->pos = pos;
if (NULL != pos->ksk_uri)
- GNUNET_FS_uri_ksk_get_keywords (pos->ksk_uri, &remove_high_frequency_keywords, tc);
+ {
+ struct GNUNET_FS_Uri *ksk_uri_copy = GNUNET_FS_uri_dup (pos->ksk_uri);
+ GNUNET_FS_uri_ksk_get_keywords (ksk_uri_copy, &remove_high_frequency_keywords, tc);
+ GNUNET_FS_uri_destroy (ksk_uri_copy);
+ }
}
/* add high-frequency meta data and keywords to parent */
if (toplevel == NULL)
return;
- tc.keywordcounter = GNUNET_CONTAINER_multihashmap_create (1024);
- tc.metacounter = GNUNET_CONTAINER_multihashmap_create (1024);
+ tc.keywordcounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO);
+ tc.metacounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO);
share_tree_trim (&tc, toplevel);
GNUNET_CONTAINER_multihashmap_destroy (tc.keywordcounter);
GNUNET_CONTAINER_multihashmap_destroy (tc.metacounter);