From: Christian Grothoff Date: Fri, 27 Aug 2010 12:20:27 +0000 (+0000) Subject: fixes X-Git-Tag: initial-import-from-subversion-38251~20526 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=920b7f6c8d43d32a6ad604a223bb8aa8a3da12d7;p=oweals%2Fgnunet.git fixes --- 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, GNUNET_DATACACHE_destroy (ret); return NULL; } - GNUNET_assert (ret->api->get != NULL); return ret; } @@ -245,7 +244,6 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, { uint32_t used; - GNUNET_assert (h->api->get != NULL); used = h->api->put (h->api->cls, key, size, @@ -287,7 +285,6 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, GNUNET_DATACACHE_Iterator iter, void *iter_cls) { - GNUNET_assert (h->api->get != NULL); GNUNET_STATISTICS_update (h->stats, gettext_noop ("# requests received"), 1, @@ -301,7 +298,6 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, GNUNET_NO); return 0; /* can not be present */ } - GNUNET_assert (h->api->get != NULL); return h->api->get (h->api->cls, key, 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, PQclear (res); return 0; } + if (iter == NULL) + return cnt; if ( (3 != PQnfields (res)) || (sizeof (uint64_t) != PQfsize (res, 0)) || (sizeof (uint32_t) != PQfsize (res, 1))) @@ -494,9 +496,9 @@ postgres_plugin_del (void *cls) return GNUNET_SYSERR; } if ( (3 != PQnfields (res)) || - (sizeof (uint32_t) != PQfsize (res, 0)) || - (sizeof (uint32_t) != PQfsize (res, 1)) || - (sizeof (GNUNET_HashCode) != PQfsize (res, 2)) ) + (sizeof (size) != PQfsize (res, 0)) || + (sizeof (oid) != PQfsize (res, 1)) || + (sizeof (GNUNET_HashCode) != PQgetlength (res, 0, 2)) ) { GNUNET_break (0); 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, buf, 1+i, exp)); - fprintf (stderr, "G"); ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1+i, NULL, NULL));