gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15008 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r15008 - gnunet/src/datastore
Date: Fri, 15 Apr 2011 21:46:04 +0200

Author: grothoff
Date: 2011-04-15 21:46:04 +0200 (Fri, 15 Apr 2011)
New Revision: 15008

Modified:
   gnunet/src/datastore/gnunet-service-datastore.c
   gnunet/src/datastore/plugin_datastore_mysql.c
   gnunet/src/datastore/test_datastore_api_data_mysql.conf
   gnunet/src/datastore/test_datastore_api_data_sqlite.conf
Log:
debugging

Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c     2011-04-15 17:22:13 UTC 
(rev 15007)
+++ gnunet/src/datastore/gnunet-service-datastore.c     2011-04-15 19:46:04 UTC 
(rev 15008)
@@ -1345,6 +1345,9 @@
 {
   struct RemoveContext *rc = cls;
 
+  fprintf (stderr,
+          "remove called with key %p\n",
+          key);
   if (key == NULL)
     {
 #if DEBUG_DATASTORE
@@ -1389,8 +1392,8 @@
  */
 static void
 handle_remove (void *cls,
-            struct GNUNET_SERVER_Client *client,
-            const struct GNUNET_MessageHeader *message)
+              struct GNUNET_SERVER_Client *client,
+              const struct GNUNET_MessageHeader *message)
 {
   const struct DataMessage *dm = check_data (message);
   GNUNET_HashCode vhash;
@@ -1419,6 +1422,13 @@
   GNUNET_CRYPTO_hash (&dm[1],
                      ntohl(dm->size),
                      &vhash);
+  fprintf (stderr,
+          "remove does get for key %s\n",
+          GNUNET_h2s (&dm->key));
+  fprintf (stderr,
+          "remove does get for %u vhash %s\n",
+          ntohl (dm->type),
+          GNUNET_h2s (&vhash));
   plugin->api->get (plugin->api->cls,
                    &dm->key,
                    &vhash,

Modified: gnunet/src/datastore/plugin_datastore_mysql.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_mysql.c       2011-04-15 17:22:13 UTC 
(rev 15007)
+++ gnunet/src/datastore/plugin_datastore_mysql.c       2011-04-15 19:46:04 UTC 
(rev 15008)
@@ -844,7 +844,7 @@
                                NULL,
                                MYSQL_TYPE_LONGLONG, &uid, GNUNET_YES,
                                -1);
-  if (ret > 0)
+  if (ret >= 0)
     return GNUNET_OK;
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
              "Deleting value %llu from gn090 table failed\n",
@@ -864,8 +864,9 @@
 static int
 return_ok (void *cls, 
           unsigned int num_values, 
-          MYSQL_BIND * values)
+          MYSQL_BIND *values)
 {
+  fprintf (stderr, "Here: %u\n", num_values);
   return GNUNET_OK;
 }
 
@@ -947,6 +948,16 @@
   hashSize2 = sizeof (GNUNET_HashCode);
   lsize = size;
   GNUNET_CRYPTO_hash (data, size, &vhash);
+  {
+  fprintf (stderr,
+          "inserting content with key `%s'\n",
+          GNUNET_h2s (key));
+  fprintf (stderr,
+          "inserting %u-byte content with vhash `%s'\n",
+          (unsigned int) size,
+          GNUNET_h2s (&vhash));
+  }
+
   if (GNUNET_OK !=
       prepared_statement_run (plugin,
                              plugin->insert_entry,
@@ -1117,6 +1128,19 @@
              exp);
 #endif
   expiration.abs_value = exp;
+
+  {
+  GNUNET_HashCode vh;
+  
+  GNUNET_CRYPTO_hash (value, size, &vh);
+  fprintf (stderr,
+          "found content under with key `%s'\n",
+          GNUNET_h2s (&key));
+  fprintf (stderr,
+          "found %u-byte content with vhash `%s'\n",
+          (unsigned int) size,
+          GNUNET_h2s (&vh));
+}
   ret = nrc->dviter (nrc->dviter_cls, 
                     (nrc->one_shot == GNUNET_YES) ? NULL : nrc,
                     &key,
@@ -1255,6 +1279,12 @@
     {
       if (gc->have_vhash)
        {
+         fprintf (stderr,
+                  "Select by key `%s'\n",
+                  GNUNET_h2s (&gc->key));
+         fprintf (stderr,
+                  "Select by vhash `%s'\n",
+                  GNUNET_h2s (&gc->vhash));
          ret =
            prepared_statement_run_select (plugin,
                                           
plugin->select_entry_by_hash_and_vhash, 
@@ -1313,11 +1343,13 @@
   struct NextRequestClosure *nrc;
   long long total;
   unsigned long hashSize;
+  unsigned long hashSize2;
 
   GNUNET_assert (key != NULL);
   if (iter == NULL) 
     return;
   hashSize = sizeof (GNUNET_HashCode);
+  hashSize2 = sizeof (GNUNET_HashCode);
   memset (cbind, 0, sizeof (cbind));
   total = -1;
   cbind[0].buffer_type = MYSQL_TYPE_LONGLONG;
@@ -1333,7 +1365,7 @@
                                           1, cbind, 
                                           &return_ok, NULL,
                                           MYSQL_TYPE_BLOB, key, hashSize, 
&hashSize, 
-                                          MYSQL_TYPE_BLOB, vhash, hashSize, 
&hashSize, 
+                                          MYSQL_TYPE_BLOB, vhash, hashSize2, 
&hashSize2, 
                                           MYSQL_TYPE_LONG, &itype, GNUNET_YES,
                                           -1);
         }
@@ -1353,13 +1385,19 @@
     {
       if (vhash != NULL)
         {
+         fprintf (stderr,
+                  "Count by key `%s'\n",
+                  GNUNET_h2s (key));
+         fprintf (stderr,
+                  "Count by vhash `%s'\n",
+                  GNUNET_h2s (vhash));
           ret =
             prepared_statement_run_select (plugin,
                                           
plugin->count_entry_by_hash_and_vhash, 
                                           1, cbind,
                                           &return_ok, NULL,
                                           MYSQL_TYPE_BLOB, key, hashSize, 
&hashSize, 
-                                          MYSQL_TYPE_BLOB, vhash, hashSize, 
&hashSize, 
+                                          MYSQL_TYPE_BLOB, vhash, hashSize2, 
&hashSize2, 
                                           -1);
 
         }
@@ -1374,6 +1412,12 @@
                                           -1);
         }
     }
+  fprintf (stderr,
+          "Got %u results (ret: %d / `%s')\n",
+          (unsigned int) total,
+          ret,
+          mysql_error (plugin->dbf));
+
   if ((ret != GNUNET_OK) || (0 >= total))
     {
       iter (iter_cls, 

Modified: gnunet/src/datastore/test_datastore_api_data_mysql.conf
===================================================================
--- gnunet/src/datastore/test_datastore_api_data_mysql.conf     2011-04-15 
17:22:13 UTC (rev 15007)
+++ gnunet/src/datastore/test_datastore_api_data_mysql.conf     2011-04-15 
19:46:04 UTC (rev 15008)
@@ -21,7 +21,6 @@
 QUOTA = 10000000
 BLOOMFILTER = $SERVICEHOME/fs/bloomfilter
 DATABASE = mysql
-DISABLE_SOCKET_FORWARDING = YES
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =

Modified: gnunet/src/datastore/test_datastore_api_data_sqlite.conf
===================================================================
--- gnunet/src/datastore/test_datastore_api_data_sqlite.conf    2011-04-15 
17:22:13 UTC (rev 15007)
+++ gnunet/src/datastore/test_datastore_api_data_sqlite.conf    2011-04-15 
19:46:04 UTC (rev 15008)
@@ -44,3 +44,5 @@
 AUTOSTART = NO
 
 
+[fs]
+AUTOSTART = NO




reply via email to

[Prev in Thread] Current Thread [Next in Thread]