aboutsummaryrefslogtreecommitdiff
path: root/src/datacache/plugin_datacache_heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datacache/plugin_datacache_heap.c')
-rw-r--r--src/datacache/plugin_datacache_heap.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c
index aee6cd5b8..e930705f2 100644
--- a/src/datacache/plugin_datacache_heap.c
+++ b/src/datacache/plugin_datacache_heap.c
@@ -95,7 +95,7 @@ struct Value
95 * Type of the block. 95 * Type of the block.
96 */ 96 */
97 enum GNUNET_BLOCK_Type type; 97 enum GNUNET_BLOCK_Type type;
98 98
99}; 99};
100 100
101 101
@@ -110,7 +110,7 @@ struct PutContext
110 /** 110 /**
111 * Expiration time for the new value. 111 * Expiration time for the new value.
112 */ 112 */
113 struct GNUNET_TIME_Absolute discard_time; 113 struct GNUNET_TIME_Absolute discard_time;
114 114
115 /** 115 /**
116 * Data for the new value. 116 * Data for the new value.
@@ -155,7 +155,7 @@ struct PutContext
155 * 155 *
156 * @param cls the 'struct PutContext' 156 * @param cls the 'struct PutContext'
157 * @param key the key for the value(s) 157 * @param key the key for the value(s)
158 * @param value an existing value 158 * @param value an existing value
159 * @return GNUNET_YES if not found (to continue to iterate) 159 * @return GNUNET_YES if not found (to continue to iterate)
160 */ 160 */
161static int 161static int
@@ -170,16 +170,16 @@ put_cb (void *cls,
170 (val->type == put_ctx->type) && 170 (val->type == put_ctx->type) &&
171 (0 == memcmp (&val[1], put_ctx->data, put_ctx->size)) ) 171 (0 == memcmp (&val[1], put_ctx->data, put_ctx->size)) )
172 { 172 {
173 put_ctx->found = GNUNET_YES; 173 put_ctx->found = GNUNET_YES;
174 val->discard_time = GNUNET_TIME_absolute_max (val->discard_time, 174 val->discard_time = GNUNET_TIME_absolute_max (val->discard_time,
175 put_ctx->discard_time); 175 put_ctx->discard_time);
176 /* replace old path with new path */ 176 /* replace old path with new path */
177 GNUNET_array_grow (val->path_info, 177 GNUNET_array_grow (val->path_info,
178 val->path_info_len, 178 val->path_info_len,
179 put_ctx->path_info_len); 179 put_ctx->path_info_len);
180 memcpy (val->path_info, 180 memcpy (val->path_info,
181 put_ctx->path_info, 181 put_ctx->path_info,
182 put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity)); 182 put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity));
183 GNUNET_CONTAINER_heap_update_cost (put_ctx->heap, 183 GNUNET_CONTAINER_heap_update_cost (put_ctx->heap,
184 val->hn, 184 val->hn,
185 val->discard_time.abs_value_us); 185 val->discard_time.abs_value_us);
@@ -289,7 +289,7 @@ struct GetContext
289 * 289 *
290 * @param cls the 'struct GetContext' 290 * @param cls the 'struct GetContext'
291 * @param key the key for the value(s) 291 * @param key the key for the value(s)
292 * @param value an existing value 292 * @param value an existing value
293 * @return GNUNET_YES to continue to iterate 293 * @return GNUNET_YES to continue to iterate
294 */ 294 */
295static int 295static int
@@ -341,7 +341,7 @@ heap_plugin_get (void *cls, const struct GNUNET_HashCode * key,
341 341
342 get_ctx.type = type; 342 get_ctx.type = type;
343 get_ctx.iter = iter; 343 get_ctx.iter = iter;
344 get_ctx.iter_cls = iter_cls; 344 get_ctx.iter_cls = iter_cls;
345 get_ctx.cnt = 0; 345 get_ctx.cnt = 0;
346 GNUNET_CONTAINER_multihashmap_get_multiple (plugin->map, 346 GNUNET_CONTAINER_multihashmap_get_multiple (plugin->map,
347 key, 347 key,
@@ -363,7 +363,7 @@ heap_plugin_del (void *cls)
363{ 363{
364 struct Plugin *plugin = cls; 364 struct Plugin *plugin = cls;
365 struct Value *val; 365 struct Value *val;
366 366
367 val = GNUNET_CONTAINER_heap_remove_root (plugin->heap); 367 val = GNUNET_CONTAINER_heap_remove_root (plugin->heap);
368 if (NULL == val) 368 if (NULL == val)
369 return GNUNET_SYSERR; 369 return GNUNET_SYSERR;