* Type of the block.
*/
enum GNUNET_BLOCK_Type type;
-
+
};
/**
* Expiration time for the new value.
*/
- struct GNUNET_TIME_Absolute discard_time;
+ struct GNUNET_TIME_Absolute discard_time;
/**
* Data for the new value.
*
* @param cls the 'struct PutContext'
* @param key the key for the value(s)
- * @param value an existing value
+ * @param value an existing value
* @return GNUNET_YES if not found (to continue to iterate)
*/
static int
(val->type == put_ctx->type) &&
(0 == memcmp (&val[1], put_ctx->data, put_ctx->size)) )
{
- put_ctx->found = GNUNET_YES;
+ put_ctx->found = GNUNET_YES;
val->discard_time = GNUNET_TIME_absolute_max (val->discard_time,
put_ctx->discard_time);
/* replace old path with new path */
GNUNET_array_grow (val->path_info,
val->path_info_len,
put_ctx->path_info_len);
- memcpy (val->path_info,
+ memcpy (val->path_info,
put_ctx->path_info,
- put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity));
+ put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity));
GNUNET_CONTAINER_heap_update_cost (put_ctx->heap,
val->hn,
- val->discard_time.abs_value);
- return GNUNET_NO;
- }
- if (val->type == put_ctx->type)
+ val->discard_time.abs_value_us);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Got another value for key %s and type %d (size %u vs %u)\n",
+ "Got same value for key %s and type %d (size %u vs %u)\n",
GNUNET_h2s (key),
val->type,
(unsigned int) val->size,
(unsigned int) put_ctx->size);
+ return GNUNET_NO;
+ }
return GNUNET_YES;
}
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
val->hn = GNUNET_CONTAINER_heap_insert (plugin->heap,
val,
- val->discard_time.abs_value);
+ val->discard_time.abs_value_us);
return size + OVERHEAD;
}
*
* @param cls the 'struct GetContext'
* @param key the key for the value(s)
- * @param value an existing value
+ * @param value an existing value
* @return GNUNET_YES to continue to iterate
*/
static int
get_ctx.type = type;
get_ctx.iter = iter;
- get_ctx.iter_cls = iter_cls;
+ get_ctx.iter_cls = iter_cls;
get_ctx.cnt = 0;
GNUNET_CONTAINER_multihashmap_get_multiple (plugin->map,
key,
{
struct Plugin *plugin = cls;
struct Value *val;
-
+
val = GNUNET_CONTAINER_heap_remove_root (plugin->heap);
if (NULL == val)
return GNUNET_SYSERR;