aboutsummaryrefslogtreecommitdiff
path: root/src/datacache/datacache.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-27 11:42:09 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-27 11:42:09 +0000
commitfb948e1e36718621b4dcc92b2a6f54c470812eb4 (patch)
tree96fe28cd7f139cdcd0ec5ae3c7ccc2ed56ad2919 /src/datacache/datacache.c
parent7222ddd36eb376fc2b1465a700d8ae496af006b7 (diff)
downloadgnunet-fb948e1e36718621b4dcc92b2a6f54c470812eb4.tar.gz
gnunet-fb948e1e36718621b4dcc92b2a6f54c470812eb4.zip
implementing delete
Diffstat (limited to 'src/datacache/datacache.c')
-rw-r--r--src/datacache/datacache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c
index 0ad9b9df4..6e9b07708 100644
--- a/src/datacache/datacache.c
+++ b/src/datacache/datacache.c
@@ -191,6 +191,7 @@ GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
191 GNUNET_DATACACHE_destroy (ret); 191 GNUNET_DATACACHE_destroy (ret);
192 return NULL; 192 return NULL;
193 } 193 }
194 GNUNET_assert (ret->api->get != NULL);
194 return ret; 195 return ret;
195} 196}
196 197
@@ -244,6 +245,7 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
244{ 245{
245 uint32_t used; 246 uint32_t used;
246 247
248 GNUNET_assert (h->api->get != NULL);
247 used = h->api->put (h->api->cls, 249 used = h->api->put (h->api->cls,
248 key, 250 key,
249 size, 251 size,
@@ -251,7 +253,10 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
251 type, 253 type,
252 discard_time); 254 discard_time);
253 if (used == 0) 255 if (used == 0)
254 return GNUNET_SYSERR; 256 {
257 GNUNET_break (0);
258 return GNUNET_SYSERR;
259 }
255 GNUNET_STATISTICS_update (h->stats, 260 GNUNET_STATISTICS_update (h->stats,
256 gettext_noop ("# bytes stored"), 261 gettext_noop ("# bytes stored"),
257 size, 262 size,
@@ -282,6 +287,7 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
282 GNUNET_DATACACHE_Iterator iter, 287 GNUNET_DATACACHE_Iterator iter,
283 void *iter_cls) 288 void *iter_cls)
284{ 289{
290 GNUNET_assert (h->api->get != NULL);
285 GNUNET_STATISTICS_update (h->stats, 291 GNUNET_STATISTICS_update (h->stats,
286 gettext_noop ("# requests received"), 292 gettext_noop ("# requests received"),
287 1, 293 1,
@@ -295,6 +301,7 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
295 GNUNET_NO); 301 GNUNET_NO);
296 return 0; /* can not be present */ 302 return 0; /* can not be present */
297 } 303 }
304 GNUNET_assert (h->api->get != NULL);
298 return h->api->get (h->api->cls, 305 return h->api->get (h->api->cls,
299 key, 306 key,
300 type, 307 type,