[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r12740 - gnunet/src/datastore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r12740 - gnunet/src/datastore |
Date: |
Thu, 26 Aug 2010 14:14:19 +0200 |
Author: grothoff
Date: 2010-08-26 14:14:19 +0200 (Thu, 26 Aug 2010)
New Revision: 12740
Modified:
gnunet/src/datastore/plugin_datastore_postgres.c
gnunet/src/datastore/test_datastore_api.c
gnunet/src/datastore/test_datastore_api_data_postgres.conf
Log:
fixes
Modified: gnunet/src/datastore/plugin_datastore_postgres.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_postgres.c 2010-08-26 12:11:33 UTC
(rev 12739)
+++ gnunet/src/datastore/plugin_datastore_postgres.c 2010-08-26 12:14:19 UTC
(rev 12740)
@@ -523,11 +523,13 @@
return GNUNET_SYSERR;
PQclear (ret);
plugin->payload += size;
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Stored %u bytes in database, new payload is %llu\n",
(unsigned int) size,
(unsigned long long) plugin->payload);
+#endif
return GNUNET_OK;
}
@@ -561,10 +563,12 @@
if ( (GNUNET_YES == nrc->end_it) ||
(nrc->count == nrc->total) )
{
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Ending iteration (%s)\n",
(GNUNET_YES == nrc->end_it) ? "client requested it" :
"completed result set");
+#endif
nrc->iter (nrc->iter_cls,
NULL, NULL, 0, NULL, 0, 0, 0,
GNUNET_TIME_UNIT_ZERO_ABS, 0);
@@ -592,9 +596,11 @@
nrc->pname,
__LINE__))
{
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Ending iteration (postgres error)\n");
+#endif
nrc->iter (nrc->iter_cls,
NULL, NULL, 0, NULL, 0, 0, 0,
GNUNET_TIME_UNIT_ZERO_ABS, 0);
@@ -605,9 +611,11 @@
if (0 == PQntuples (res))
{
/* no result */
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Ending iteration (no more results)\n");
+#endif
nrc->iter (nrc->iter_cls,
NULL, NULL, 0, NULL, 0, 0, 0,
GNUNET_TIME_UNIT_ZERO_ABS, 0);
@@ -659,11 +667,13 @@
nrc->blast_rowid = htonl (rowid);
nrc->count++;
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Found result of size %u bytes and type %u in database\n",
(unsigned int) size,
(unsigned int) type);
+#endif
iret = nrc->iter (nrc->iter_cls,
nrc,
&key,
@@ -677,27 +687,33 @@
PQclear (res);
if (iret == GNUNET_SYSERR)
{
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Ending iteration (client error)\n");
+#endif
return;
}
if (iret == GNUNET_NO)
{
if (GNUNET_OK == delete_by_rowid (plugin, rowid))
{
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Deleting %u bytes from database, current payload is
%llu\n",
(unsigned int) size,
(unsigned long long) plugin->payload);
+#endif
GNUNET_assert (plugin->payload >= size);
plugin->payload -= size;
+#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"postgres",
"Deleted %u bytes from database, new payload is
%llu\n",
(unsigned int) size,
(unsigned long long) plugin->payload);
+#endif
}
}
}
@@ -1048,8 +1064,6 @@
return;
}
nrc->total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret,
0, 0));
- fprintf (stderr, "Total number of results: %llu\n",
- (unsigned long long) nrc->total);
PQclear (ret);
if (nrc->total == 0)
{
Modified: gnunet/src/datastore/test_datastore_api.c
===================================================================
--- gnunet/src/datastore/test_datastore_api.c 2010-08-26 12:11:33 UTC (rev
12739)
+++ gnunet/src/datastore/test_datastore_api.c 2010-08-26 12:14:19 UTC (rev
12740)
@@ -31,7 +31,7 @@
#include "gnunet_protocols.h"
#include "gnunet_datastore_service.h"
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
#define START_DATASTORE GNUNET_YES
Modified: gnunet/src/datastore/test_datastore_api_data_postgres.conf
===================================================================
--- gnunet/src/datastore/test_datastore_api_data_postgres.conf 2010-08-26
12:11:33 UTC (rev 12739)
+++ gnunet/src/datastore/test_datastore_api_data_postgres.conf 2010-08-26
12:14:19 UTC (rev 12740)
@@ -30,7 +30,7 @@
# REJECT_FROM =
# REJECT_FROM6 =
# PREFIX =
-DEBUG = YES
+# DEBUG = YES
# PREFIX = xterm -T datastore -e gdb --args
# PREFIX = valgrind --tool=memcheck --leak-check=yes
BINARY = gnunet-service-datastore
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r12740 - gnunet/src/datastore,
gnunet <=