gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13946 - in branches/gnunet/mantis_0001616: . src/datacache


From: gnunet
Subject: [GNUnet-SVN] r13946 - in branches/gnunet/mantis_0001616: . src/datacache src/datastore src/dht src/transport src/util
Date: Mon, 20 Dec 2010 21:00:40 +0100

Author: durner
Date: 2010-12-20 21:00:40 +0100 (Mon, 20 Dec 2010)
New Revision: 13946

Modified:
   branches/gnunet/mantis_0001616/
   branches/gnunet/mantis_0001616/src/datacache/perf_datacache.c
   branches/gnunet/mantis_0001616/src/datacache/plugin_datacache_sqlite.c
   branches/gnunet/mantis_0001616/src/datacache/test_datacache.c
   branches/gnunet/mantis_0001616/src/datacache/test_datacache_quota.c
   branches/gnunet/mantis_0001616/src/datastore/perf_datastore_api.c
   branches/gnunet/mantis_0001616/src/datastore/perf_plugin_datastore.c
   branches/gnunet/mantis_0001616/src/datastore/plugin_datastore_sqlite.c
   branches/gnunet/mantis_0001616/src/datastore/test_datastore_api.c
   branches/gnunet/mantis_0001616/src/datastore/test_datastore_api_management.c
   branches/gnunet/mantis_0001616/src/dht/test_dht_api.c
   branches/gnunet/mantis_0001616/src/transport/test_quota_compliance.c
   branches/gnunet/mantis_0001616/src/util/crypto_hash.c
Log:
update from trunk


Property changes on: branches/gnunet/mantis_0001616
___________________________________________________________________
Modified: svn:mergeinfo
   - /gnunet:13878-13927
   + /gnunet:13878-13945

Modified: branches/gnunet/mantis_0001616/src/datacache/perf_datacache.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datacache/perf_datacache.c       
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datacache/perf_datacache.c       
2010-12-20 20:00:40 UTC (rev 13946)
@@ -131,7 +131,7 @@
 int
 main (int argc, char *argv[])
 {
-  const char *pos;
+  char *pos;
   char cfg_name[128];
   char *const xargv[] = { 
     "perf-datacache",
@@ -157,10 +157,17 @@
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
+  
   GNUNET_snprintf (cfg_name,
                   sizeof (cfg_name),
                   "perf_datacache_data_%s.conf",
                   plugin_name);
+  if (pos != plugin_name)
+    pos[0] = '.';
   GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
                       xargv, "perf-datacache", "nohelp",
                       options, &run, NULL);

Modified: branches/gnunet/mantis_0001616/src/datacache/plugin_datacache_sqlite.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datacache/plugin_datacache_sqlite.c      
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datacache/plugin_datacache_sqlite.c      
2010-12-20 20:00:40 UTC (rev 13946)
@@ -423,13 +423,56 @@
 {
   struct GNUNET_DATACACHE_PluginFunctions *api = cls;
   struct Plugin *plugin = api->cls;
+  int result;
+#if SQLITE_VERSION_NUMBER >= 3007000
+  sqlite3_stmt *stmt;
+#endif
 
+#if !WINDOWS || defined(__CYGWIN__)
   if (0 != UNLINK (plugin->fn))
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
                              "unlink", 
                              plugin->fn);
   GNUNET_free (plugin->fn);
-  sqlite3_close (plugin->dbh);
+#endif
+  result = sqlite3_close (plugin->dbh);
+#if SQLITE_VERSION_NUMBER >= 3007000
+  if (result == SQLITE_BUSY)
+    {
+      GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, 
+                      "sqlite",
+                      _("Tried to close sqlite without finalizing all prepared 
statements.\n"));
+      stmt = sqlite3_next_stmt(plugin->dbh, NULL); 
+      while (stmt != NULL)
+        {
+#if DEBUG_SQLITE
+          GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                          "sqlite", "Closing statement %p\n", stmt);
+#endif
+          result = sqlite3_finalize(stmt);
+#if DEBUG_SQLITE
+          if (result != SQLITE_OK)
+           GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                            "sqlite",
+                            "Failed to close statement %p: %d\n", stmt, 
result);
+#endif
+         stmt = sqlite3_next_stmt(plugin->dbh, NULL);
+        }
+      result = sqlite3_close(plugin->dbh);
+    }
+#endif
+  if (SQLITE_OK != result)
+    LOG_SQLITE (plugin->dbh,
+               GNUNET_ERROR_TYPE_ERROR, 
+               "sqlite3_close");
+
+#if WINDOWS && !defined(__CYGWIN__)
+  if (0 != UNLINK (plugin->fn))
+    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
+                             "unlink", 
+                             plugin->fn);
+  GNUNET_free (plugin->fn);
+#endif
   GNUNET_free (plugin);
   GNUNET_free (api);
   return NULL;

Modified: branches/gnunet/mantis_0001616/src/datacache/test_datacache.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datacache/test_datacache.c       
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datacache/test_datacache.c       
2010-12-20 20:00:40 UTC (rev 13946)
@@ -130,7 +130,7 @@
 int
 main (int argc, char *argv[])
 {
-  const char *pos;
+  char *pos;
   char cfg_name[128];
   char *const xargv[] = { 
     "test-datacache",
@@ -156,10 +156,17 @@
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
+  
   GNUNET_snprintf (cfg_name,
                   sizeof (cfg_name),
                   "test_datacache_data_%s.conf",
                   plugin_name);
+  if (pos != plugin_name)
+    pos[0] = '.';
   GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
                       xargv, "test-datacache", "nohelp",
                       options, &run, NULL);

Modified: branches/gnunet/mantis_0001616/src/datacache/test_datacache_quota.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datacache/test_datacache_quota.c 
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datacache/test_datacache_quota.c 
2010-12-20 20:00:40 UTC (rev 13946)
@@ -121,7 +121,7 @@
 int
 main (int argc, char *argv[])
 {
-  const char *pos;
+  char *pos;
   char cfg_name[128];
   char *const xargv[] = { 
     "test-datacache-quota",
@@ -143,14 +143,22 @@
                     "WARNING",
 #endif
                     NULL);
+
   /* determine name of plugin to use */
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
+  
   GNUNET_snprintf (cfg_name,
                   sizeof (cfg_name),
                   "test_datacache_data_%s.conf",
                   plugin_name);
+  if (pos != plugin_name)
+    pos[0] = '.';
   GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
                       xargv, "test-datacache-quota", "nohelp",
                       options, &run, NULL);

Modified: branches/gnunet/mantis_0001616/src/datastore/perf_datastore_api.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datastore/perf_datastore_api.c   
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datastore/perf_datastore_api.c   
2010-12-20 20:00:40 UTC (rev 13946)
@@ -407,13 +407,17 @@
 main (int argc, char *argv[])
 {
   int ret;
-  const char *pos;
+  char *pos;
   char dir_name[128];
 
   /* determine name of plugin to use */
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
 
   GNUNET_snprintf (dir_name,
                   sizeof (dir_name),
@@ -428,6 +432,8 @@
 #endif
                     NULL);
   ret = check ();
+  if (pos != plugin_name)
+    pos[0] = '.';
 #if REPORT_ID
   fprintf (stderr, "\n");
 #endif

Modified: branches/gnunet/mantis_0001616/src/datastore/perf_plugin_datastore.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datastore/perf_plugin_datastore.c        
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datastore/perf_plugin_datastore.c        
2010-12-20 20:00:40 UTC (rev 13946)
@@ -415,13 +415,17 @@
 main (int argc, char *argv[])
 {
   int ret;
-  const char *pos;
+  char *pos;
   char dir_name[128];
 
   /* determine name of plugin to use */
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
 
   GNUNET_snprintf (dir_name,
                   sizeof (dir_name),
@@ -436,6 +440,8 @@
 #endif
                     NULL);
   ret = check ();
+  if (pos != plugin_name)
+    pos[0] = '.';
   GNUNET_DISK_directory_remove (dir_name);
 
   return ret;

Modified: branches/gnunet/mantis_0001616/src/datastore/plugin_datastore_sqlite.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datastore/plugin_datastore_sqlite.c      
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datastore/plugin_datastore_sqlite.c      
2010-12-20 20:00:40 UTC (rev 13946)
@@ -28,7 +28,7 @@
 #include "gnunet_datastore_plugin.h"
 #include <sqlite3.h>
 
-#define DEBUG_SQLITE GNUNET_YES
+#define DEBUG_SQLITE GNUNET_NO
 
 
 /**
@@ -105,6 +105,11 @@
   sqlite3 *dbh;
 
   /**
+   * Precompiled SQL for deletion.
+   */
+  sqlite3_stmt *delRow;
+
+  /**
    * Precompiled SQL for update.
    */
   sqlite3_stmt *updPrio;
@@ -145,9 +150,16 @@
             sqlite3_stmt ** ppStmt)
 {
   char *dummy;
-  return sqlite3_prepare_v2 (dbh,
-                            zSql,
-                            strlen (zSql), ppStmt, (const char **) &dummy);
+  int result;
+  result = sqlite3_prepare_v2 (dbh,
+                              zSql,
+                              strlen (zSql), ppStmt, (const char **) &dummy);
+#if DEBUG_SQLITE
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                  "sqlite",
+                   "Prepared %p: %d\n", *ppStmt, result);
+#endif
+  return result;
 }
 
 
@@ -324,12 +336,16 @@
                    "INSERT INTO gn080 (size, type, prio, "
                    "anonLevel, expire, hash, vhash, value) VALUES "
                    "(?, ?, ?, ?, ?, ?, ?, ?)",
-                   &plugin->insertContent) != SQLITE_OK))
+                   &plugin->insertContent) != SQLITE_OK) ||
+      (sq_prepare (plugin->dbh,
+                   "DELETE FROM gn080 WHERE _ROWID_ = ?",
+                   &plugin->delRow) != SQLITE_OK))
     {
       LOG_SQLITE (plugin, NULL,
                   GNUNET_ERROR_TYPE_ERROR, "precompiling");
       return GNUNET_SYSERR;
     }
+
   return GNUNET_OK;
 }
 
@@ -342,11 +358,48 @@
 static void
 database_shutdown (struct Plugin *plugin)
 {
+  int result;
+#if SQLITE_VERSION_NUMBER >= 3007000
+  sqlite3_stmt *stmt;
+#endif
+
+  if (plugin->delRow != NULL)
+    sqlite3_finalize (plugin->delRow);
   if (plugin->updPrio != NULL)
     sqlite3_finalize (plugin->updPrio);
   if (plugin->insertContent != NULL)
     sqlite3_finalize (plugin->insertContent);
-  sqlite3_close (plugin->dbh);
+  result = sqlite3_close(plugin->dbh);
+#if SQLITE_VERSION_NUMBER >= 3007000
+  if (result == SQLITE_BUSY)
+    {
+      GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, 
+                      "sqlite",
+                      _("Tried to close sqlite without finalizing all prepared 
statements.\n"));
+      stmt = sqlite3_next_stmt(plugin->dbh, NULL); 
+      while (stmt != NULL)
+        {
+#if DEBUG_SQLITE
+          GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                    "sqlite", "Closing statement %p\n", stmt);
+#endif
+          result = sqlite3_finalize(stmt);
+#if DEBUG_SQLITE
+          if (result != SQLITE_OK)
+              GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                              "sqlite",
+                               "Failed to close statement %p: %d\n", stmt, 
result);
+#endif
+         stmt = sqlite3_next_stmt(plugin->dbh, NULL);
+        }
+      result = sqlite3_close(plugin->dbh);
+    }
+#endif
+  if (SQLITE_OK != result)
+      LOG_SQLITE (plugin, NULL,
+                  GNUNET_ERROR_TYPE_ERROR, 
+                 "sqlite3_close");
+
   GNUNET_free_non_null (plugin->fn);
 }
 
@@ -362,26 +415,23 @@
 delete_by_rowid (struct Plugin* plugin, 
                 unsigned long long rid)
 {
-  sqlite3_stmt *stmt;
 
-  if (sq_prepare (plugin->dbh,
-                  "DELETE FROM gn080 WHERE _ROWID_ = ?", &stmt) != SQLITE_OK)
+  sqlite3_bind_int64 (plugin->delRow, 1, rid);
+  if (SQLITE_DONE != sqlite3_step (plugin->delRow))
     {
       LOG_SQLITE (plugin, NULL,
                   GNUNET_ERROR_TYPE_ERROR |
-                  GNUNET_ERROR_TYPE_BULK, "sq_prepare");
+                  GNUNET_ERROR_TYPE_BULK, "sqlite3_step");
+      if (SQLITE_OK != sqlite3_reset (plugin->delRow))
+          LOG_SQLITE (plugin, NULL,
+                      GNUNET_ERROR_TYPE_ERROR |
+                      GNUNET_ERROR_TYPE_BULK, "sqlite3_reset");
       return GNUNET_SYSERR;
     }
-  sqlite3_bind_int64 (stmt, 1, rid);
-  if (SQLITE_DONE != sqlite3_step (stmt))
-    {
+  if (SQLITE_OK != sqlite3_reset (plugin->delRow))
       LOG_SQLITE (plugin, NULL,
                   GNUNET_ERROR_TYPE_ERROR |
-                  GNUNET_ERROR_TYPE_BULK, "sqlite3_step");
-      sqlite3_finalize (stmt);
-      return GNUNET_SYSERR;
-    }
-  sqlite3_finalize (stmt);
+                  GNUNET_ERROR_TYPE_BULK, "sqlite3_reset");
   return GNUNET_OK;
 }
 
@@ -1167,7 +1217,7 @@
  * Call sqlite using the already prepared query to get
  * the next result.
  *
- * @param cls not used
+ * @param cls context with the prepared query
  * @param nc context with the prepared query
  * @return GNUNET_OK on success, GNUNET_SYSERR on error, GNUNET_NO if
  *        there are no more results 
@@ -1185,6 +1235,10 @@
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Asked to clean up iterator state.\n");
 #endif
+      nc = (struct NextContext *)cls;
+      if (nc->stmt)
+          sqlite3_finalize (nc->stmt);
+      nc->stmt = NULL;
       return GNUNET_SYSERR;
     }
   plugin = nc->plugin;
@@ -1241,7 +1295,7 @@
   nc->iter_cls = iter_cls;
   nc->stmt = stmt;
   nc->prep = &all_next_prepare;
-  nc->prep_cls = NULL;
+  nc->prep_cls = nc;
   sqlite_next_request (nc, GNUNET_NO);
 }
 
@@ -1595,10 +1649,26 @@
   struct GNUNET_DATASTORE_PluginFunctions *api = cls;
   struct Plugin *plugin = api->cls;
 
+#if DEBUG_SQLITE
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                  "sqlite",
+                  "sqlite plugin is doneing\n");
+#endif
+
   if (plugin->next_task != GNUNET_SCHEDULER_NO_TASK)
     {
+#if DEBUG_SQLITE
+      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                      "sqlite",
+                      "Canceling next task\n");
+#endif
       GNUNET_SCHEDULER_cancel (plugin->next_task);
       plugin->next_task = GNUNET_SCHEDULER_NO_TASK;
+#if DEBUG_SQLITE
+      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                      "sqlite",
+                      "Prep'ing next task\n");
+#endif
       plugin->next_task_nc->prep (plugin->next_task_nc->prep_cls, NULL);
       GNUNET_free (plugin->next_task_nc);
       plugin->next_task_nc = NULL;
@@ -1606,6 +1676,11 @@
   fn = NULL;
   if (plugin->drop_on_shutdown)
     fn = GNUNET_strdup (plugin->fn);
+#if DEBUG_SQLITE
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                  "sqlite",
+                  "Shutting down database\n");
+#endif
   database_shutdown (plugin);
   plugin->env = NULL; 
   GNUNET_free (api);
@@ -1617,6 +1692,11 @@
                                  fn);
       GNUNET_free (fn);
     }
+#if DEBUG_SQLITE
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                  "sqlite",
+                  "sqlite plugin is finished doneing\n");
+#endif
   return NULL;
 }
 

Modified: branches/gnunet/mantis_0001616/src/datastore/test_datastore_api.c
===================================================================
--- branches/gnunet/mantis_0001616/src/datastore/test_datastore_api.c   
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/datastore/test_datastore_api.c   
2010-12-20 20:00:40 UTC (rev 13946)
@@ -678,13 +678,17 @@
 main (int argc, char *argv[])
 {
   int ret;
-  const char *pos;
+  char *pos;
   char dir_name[128];
 
   /* determine name of plugin to use */
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
 
   GNUNET_snprintf (dir_name,
                   sizeof (dir_name),
@@ -699,6 +703,8 @@
 #endif
                     NULL);
   ret = check ();
+  if (pos != plugin_name)
+    pos[0] = '.';
   GNUNET_DISK_directory_remove (dir_name);
   return ret;
 }

Modified: 
branches/gnunet/mantis_0001616/src/datastore/test_datastore_api_management.c
===================================================================
--- 
branches/gnunet/mantis_0001616/src/datastore/test_datastore_api_management.c    
    2010-12-20 19:58:37 UTC (rev 13945)
+++ 
branches/gnunet/mantis_0001616/src/datastore/test_datastore_api_management.c    
    2010-12-20 20:00:40 UTC (rev 13946)
@@ -388,13 +388,17 @@
 {
   int ret;
   
-  const char *pos;
+  char *pos;
   char dir_name[128];
 
   /* determine name of plugin to use */
   plugin_name = argv[0];
   while (NULL != (pos = strstr(plugin_name, "_")))
     plugin_name = pos+1;
+  if (NULL != (pos = strstr(plugin_name, ".")))
+    pos[0] = 0;
+  else
+    pos = (char *) plugin_name;
 
   GNUNET_snprintf (dir_name,
                   sizeof (dir_name),
@@ -409,6 +413,8 @@
 #endif
                     NULL);
   ret = check ();
+  if (pos != plugin_name)
+    pos[0] = '.';
   GNUNET_DISK_directory_remove (dir_name);
   return ret;
 }

Modified: branches/gnunet/mantis_0001616/src/dht/test_dht_api.c
===================================================================
--- branches/gnunet/mantis_0001616/src/dht/test_dht_api.c       2010-12-20 
19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/dht/test_dht_api.c       2010-12-20 
20:00:40 UTC (rev 13946)
@@ -180,6 +180,7 @@
   GNUNET_assert (peer->dht_handle != NULL);
 
   GNUNET_DHT_find_peer_stop (peer->find_peer_handle);
+  peer->find_peer_handle = NULL;
 
 #if HAVE_MALICIOUS
   GNUNET_DHT_set_malicious_getter (peer->dht_handle, GNUNET_TIME_UNIT_SECONDS);
@@ -356,6 +357,7 @@
     }
   GNUNET_assert (peer->dht_handle != NULL);
   GNUNET_DHT_get_stop (peer->get_handle);
+  peer->get_handle = NULL;
   GNUNET_SCHEDULER_add_now(&test_find_peer,
                           &p1);
 }

Modified: branches/gnunet/mantis_0001616/src/transport/test_quota_compliance.c
===================================================================
--- branches/gnunet/mantis_0001616/src/transport/test_quota_compliance.c        
2010-12-20 19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/transport/test_quota_compliance.c        
2010-12-20 20:00:40 UTC (rev 13946)
@@ -391,10 +391,10 @@
          quota_allowed = current_quota_p2;
 
 
-  if (MEASUREMENT_SOFT_LIMIT > (quota_allowed/10))
+  if (MEASUREMENT_SOFT_LIMIT > (quota_allowed/3))
          delta = MEASUREMENT_SOFT_LIMIT;
   else
-         delta = (quota_allowed/10);
+         delta = (quota_allowed/3);
 
   /* Throughput is far too slow. This is to prevent the test to exit with 
success when throughput is 0 */
   if ((total_bytes_sent/(duration.rel_value / 1000)) < 100)
@@ -411,7 +411,14 @@
          ok = 1;
          failed_measurement_counter--;
          if (failed_measurement_counter < 0)
+         {
+                 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                                 "\nQuota measurement failed and no free 
strike: %i\n",failed_measurement_counter);
                  end();
+         }
+         else
+                 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                                 "\nQuota measurement failed and %i free 
strikes\n",failed_measurement_counter);
          return;
   }
 
@@ -430,7 +437,14 @@
          ok = 1;
          failed_measurement_counter--;
          if (failed_measurement_counter < 0)
+         {
+                 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                                 "\nQuota measurement failed and no free 
strike: %i\n",failed_measurement_counter);
                  end();
+         }
+         else
+                 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                                 "\nQuota measurement failed and %i free 
strikes\n",failed_measurement_counter);
          return;
   }
   else

Modified: branches/gnunet/mantis_0001616/src/util/crypto_hash.c
===================================================================
--- branches/gnunet/mantis_0001616/src/util/crypto_hash.c       2010-12-20 
19:58:37 UTC (rev 13945)
+++ branches/gnunet/mantis_0001616/src/util/crypto_hash.c       2010-12-20 
20:00:40 UTC (rev 13946)
@@ -141,7 +141,7 @@
   size_t delta;
 
   fhc->task = GNUNET_SCHEDULER_NO_TASK;
-  GNUNET_assert (fhc->offset < fhc->fsize);
+  GNUNET_assert (fhc->offset <= fhc->fsize);
   delta = fhc->bsize;
   if (fhc->fsize - fhc->offset < delta)
     delta = fhc->fsize - fhc->offset;




reply via email to

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