fixc
authorChristian Grothoff <christian@grothoff.org>
Wed, 6 Apr 2011 14:05:45 +0000 (14:05 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 6 Apr 2011 14:05:45 +0000 (14:05 +0000)
src/datastore/datastore_api.c
src/datastore/gnunet-service-datastore.c
src/datastore/perf_datastore_api.c
src/datastore/plugin_datastore_sqlite.c

index f6b5cd609c560e37eb384f45b26fb0cb78438202..ef373695063ed11e94ed89c7b2239b9486571fae 100644 (file)
@@ -1272,6 +1272,8 @@ process_result_message (void *cls,
              ntohl(dm->size),
              GNUNET_h2s(&dm->key));
 #endif
+  if (GNUNET_YES == qe->one_shot)
+    free_queue_entry (qe);
   h->retry_time.rel_value = 0;
   rc.iter (rc.iter_cls,
           &dm->key,
@@ -1282,8 +1284,6 @@ process_result_message (void *cls,
           ntohl(dm->anonymity),
           GNUNET_TIME_absolute_ntoh(dm->expiration),   
           GNUNET_ntohll(dm->uid));
-  if (GNUNET_YES == qe->one_shot)
-    free_queue_entry (qe);
 }
 
 
index dde63c85f98b7cf519e2722f3c9e897978fdeaef..1a4514a1ac2eb3f2962969895402e6596bd40aad 100644 (file)
@@ -540,6 +540,10 @@ transmit_callback (void *cls,
     tcc->tc (tcc->tc_cls, GNUNET_OK);
   if (GNUNET_YES == tcc->end)
     {
+#if DEBUG_DATASTORE
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Done processing client request\n");
+#endif
       GNUNET_SERVER_receive_done (tcc->client, GNUNET_OK);
     }
   else
@@ -750,7 +754,8 @@ transmit_item (void *cls,
                            gettext_noop ("# results found"),
                            1,
                            GNUNET_NO);
-  transmit (client, &dm->header, &get_next, next_cls, GNUNET_NO);
+  transmit (client, &dm->header, &get_next, next_cls, 
+           (next_cls != NULL) ? GNUNET_NO : GNUNET_YES);
   return GNUNET_OK;
 }
 
index be2bc477b7e28537903c7305042862c8f7bf1bda..07f856b237bbd7923f2c84d0ad8d5fb2b6ccd70b 100644 (file)
@@ -226,27 +226,29 @@ run_continuation (void *cls,
       if (i > 255)
        memset (data, i - 255, size / 2);
       data[0] = k;
-      GNUNET_DATASTORE_put (datastore,
-                           0,
-                           &key,
-                           size,
-                           data,
-                           i+1,
-                           GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100),
-                           i, 0,
-                           GNUNET_TIME_relative_to_absolute 
-                           (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
-                                                           GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
-                           1, 1, TIMEOUT,
-                           &check_success, 
-                           crc);
+      GNUNET_assert (NULL !=
+                    GNUNET_DATASTORE_put (datastore,
+                                          0,
+                                          &key,
+                                          size,
+                                          data,
+                                          i+1,
+                                          GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100),
+                                          i, 0,
+                                          GNUNET_TIME_relative_to_absolute 
+                                          (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
+                                                                          GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
+                                          1, 1, TIMEOUT,
+                                          &check_success, 
+                                          crc));
       break;
     case RP_CUT:
       /* trim down below MAX_SIZE again */
-      GNUNET_DATASTORE_get_for_replication (datastore, 
-                                           1, 1, TIMEOUT,
-                                           &delete_value,
-                                           crc);
+      GNUNET_assert (NULL !=
+                    GNUNET_DATASTORE_get_for_replication (datastore, 
+                                                          1, 1, TIMEOUT,
+                                                          &delete_value,
+                                                          crc));
       break;
     case RP_REPORT:
       printf (
index 216d9b7cfedc8d29f7ed55d2ecc819504386931c..fd10a38cb0e7924957e8b70b600b48a296129652 100644 (file)
@@ -31,7 +31,7 @@
 /**
  * Enable or disable logging debug messages.
  */
-#define DEBUG_SQLITE GNUNET_YES
+#define DEBUG_SQLITE GNUNET_NO
 
 /**
  * We allocate items on the stack at times.  To prevent a stack