/**
* Query for the block.
*/
- GNUNET_HashCode query;
+ struct GNUNET_HashCode query;
/**
* When does this block expire?
unsigned int i;
struct GSF_PeerPerformanceData *ppd;
struct GNUNET_PeerIdentity id;
+ struct GNUNET_HashCode hc;
uint32_t dist;
ppd = GSF_get_peer_performance_data_ (peer->peer);
return -1;
GNUNET_assert (0 != ppd->pid);
GNUNET_PEER_resolve (ppd->pid, &id);
- dist = GNUNET_CRYPTO_hash_distance_u32 (&block->query, &id.hashPubKey);
+ GNUNET_CRYPTO_hash (&id, sizeof (struct GNUNET_PeerIdentity), &hc);
+ dist = GNUNET_CRYPTO_hash_distance_u32 (&block->query, &hc);
/* closer distance, higher score: */
return UINT32_MAX - dist;
}
* maybe 0 if no unique identifier is available
*/
static void
-process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size,
+process_migration_content (void *cls, const struct GNUNET_HashCode * key, size_t size,
const void *data, enum GNUNET_BLOCK_Type type,
uint32_t priority, uint32_t anonymity,
struct GNUNET_TIME_Absolute expiration, uint64_t uid)
consider_gathering ();
return;
}
- if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value <
- MIN_MIGRATION_CONTENT_LIFETIME.rel_value)
+ if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us <
+ MIN_MIGRATION_CONTENT_LIFETIME.rel_value_us)
{
/* content will expire soon, don't bother */
consider_gathering ();
if (GNUNET_YES != enabled)
return;
- mrp = GNUNET_malloc (sizeof (struct MigrationReadyPeer));
+ mrp = GNUNET_new (struct MigrationReadyPeer);
mrp->peer = peer;
find_content (mrp);
GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, mrp);
GNUNET_CONFIGURATION_get_value_time (GSF_cfg, "fs", "MIN_MIGRATION_DELAY",
&min_migration_delay))
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _
- ("Invalid value specified for option `%s' in section `%s', content pushing disabled\n"),
- "MIN_MIGRATION_DELAY", "fs");
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING,
+ "fs", "MIN_MIGRATION_DELAY",
+ _("time required, content pushing disabled"));
return;
}
consider_gathering ();