aboutsummaryrefslogtreecommitdiff
path: root/src/datacache
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-27 12:20:27 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-27 12:20:27 +0000
commit920b7f6c8d43d32a6ad604a223bb8aa8a3da12d7 (patch)
treee16b689cf4e6bc4f7032993c1356f0d6e35add66 /src/datacache
parentfb948e1e36718621b4dcc92b2a6f54c470812eb4 (diff)
downloadgnunet-920b7f6c8d43d32a6ad604a223bb8aa8a3da12d7.tar.gz
gnunet-920b7f6c8d43d32a6ad604a223bb8aa8a3da12d7.zip
fixes
Diffstat (limited to 'src/datacache')
-rw-r--r--src/datacache/datacache.c4
-rw-r--r--src/datacache/plugin_datacache_postgres.c8
-rw-r--r--src/datacache/test_datacache_quota.c1
3 files changed, 5 insertions, 8 deletions
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c
index 6e9b07708..9c1a90bca 100644
--- a/src/datacache/datacache.c
+++ b/src/datacache/datacache.c
@@ -191,7 +191,6 @@ 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);
195 return ret; 194 return ret;
196} 195}
197 196
@@ -245,7 +244,6 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
245{ 244{
246 uint32_t used; 245 uint32_t used;
247 246
248 GNUNET_assert (h->api->get != NULL);
249 used = h->api->put (h->api->cls, 247 used = h->api->put (h->api->cls,
250 key, 248 key,
251 size, 249 size,
@@ -287,7 +285,6 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
287 GNUNET_DATACACHE_Iterator iter, 285 GNUNET_DATACACHE_Iterator iter,
288 void *iter_cls) 286 void *iter_cls)
289{ 287{
290 GNUNET_assert (h->api->get != NULL);
291 GNUNET_STATISTICS_update (h->stats, 288 GNUNET_STATISTICS_update (h->stats,
292 gettext_noop ("# requests received"), 289 gettext_noop ("# requests received"),
293 1, 290 1,
@@ -301,7 +298,6 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
301 GNUNET_NO); 298 GNUNET_NO);
302 return 0; /* can not be present */ 299 return 0; /* can not be present */
303 } 300 }
304 GNUNET_assert (h->api->get != NULL);
305 return h->api->get (h->api->cls, 301 return h->api->get (h->api->cls,
306 key, 302 key,
307 type, 303 type,
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c
index 6bf3c7011..126979069 100644
--- a/src/datacache/plugin_datacache_postgres.c
+++ b/src/datacache/plugin_datacache_postgres.c
@@ -406,6 +406,8 @@ postgres_plugin_get (void *cls,
406 PQclear (res); 406 PQclear (res);
407 return 0; 407 return 0;
408 } 408 }
409 if (iter == NULL)
410 return cnt;
409 if ( (3 != PQnfields (res)) || 411 if ( (3 != PQnfields (res)) ||
410 (sizeof (uint64_t) != PQfsize (res, 0)) || 412 (sizeof (uint64_t) != PQfsize (res, 0)) ||
411 (sizeof (uint32_t) != PQfsize (res, 1))) 413 (sizeof (uint32_t) != PQfsize (res, 1)))
@@ -494,9 +496,9 @@ postgres_plugin_del (void *cls)
494 return GNUNET_SYSERR; 496 return GNUNET_SYSERR;
495 } 497 }
496 if ( (3 != PQnfields (res)) || 498 if ( (3 != PQnfields (res)) ||
497 (sizeof (uint32_t) != PQfsize (res, 0)) || 499 (sizeof (size) != PQfsize (res, 0)) ||
498 (sizeof (uint32_t) != PQfsize (res, 1)) || 500 (sizeof (oid) != PQfsize (res, 1)) ||
499 (sizeof (GNUNET_HashCode) != PQfsize (res, 2)) ) 501 (sizeof (GNUNET_HashCode) != PQgetlength (res, 0, 2)) )
500 { 502 {
501 GNUNET_break (0); 503 GNUNET_break (0);
502 PQclear (res); 504 PQclear (res);
diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c
index 9e1881bd8..ada5ae171 100644
--- a/src/datacache/test_datacache_quota.c
+++ b/src/datacache/test_datacache_quota.c
@@ -88,7 +88,6 @@ run (void *cls,
88 buf, 88 buf,
89 1+i, 89 1+i,
90 exp)); 90 exp));
91 fprintf (stderr, "G");
92 ASSERT (0 < GNUNET_DATACACHE_get (h, 91 ASSERT (0 < GNUNET_DATACACHE_get (h,
93 &k, 1+i, 92 &k, 1+i,
94 NULL, NULL)); 93 NULL, NULL));