[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35668 - gnunet/src/datacache
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35668 - gnunet/src/datacache |
Date: |
Wed, 29 Apr 2015 10:03:22 +0200 |
Author: grothoff
Date: 2015-04-29 10:03:22 +0200 (Wed, 29 Apr 2015)
New Revision: 35668
Modified:
gnunet/src/datacache/plugin_datacache_postgres.c
Log:
-add counter for #items
Modified: gnunet/src/datacache/plugin_datacache_postgres.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_postgres.c 2015-04-29 08:02:30 UTC
(rev 35667)
+++ gnunet/src/datacache/plugin_datacache_postgres.c 2015-04-29 08:03:22 UTC
(rev 35668)
@@ -50,6 +50,10 @@
*/
PGconn *dbh;
+ /**
+ * Number of key-value pairs in the database.
+ */
+ unsigned int num_items;
};
@@ -200,6 +204,7 @@
GNUNET_POSTGRES_check_result (plugin->dbh, ret,
PGRES_COMMAND_OK, "PQexecPrepared", "put"))
return -1;
+ plugin->num_items++;
PQclear (ret);
return size + OVERHEAD;
}
@@ -355,6 +360,7 @@
PQclear (res);
if (GNUNET_OK != GNUNET_POSTGRES_delete_by_rowid (plugin->dbh, "delrow",
oid))
return GNUNET_SYSERR;
+ plugin->num_items--;
plugin->env->delete_notify (plugin->env->cls, &key, size + OVERHEAD);
return GNUNET_OK;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35668 - gnunet/src/datacache,
gnunet <=