aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-04-06 14:05:45 +0000
committerChristian Grothoff <christian@grothoff.org>2011-04-06 14:05:45 +0000
commit50ffbcc86ee995fa741860bcdd9546a231edf2a7 (patch)
tree25e23cae811f304253d6e7c4968cd26d370727f2 /src/datastore
parentbc4438c5af9b47e2bcd0195eb041e5fff8229428 (diff)
downloadgnunet-50ffbcc86ee995fa741860bcdd9546a231edf2a7.tar.gz
gnunet-50ffbcc86ee995fa741860bcdd9546a231edf2a7.zip
fixc
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/datastore_api.c4
-rw-r--r--src/datastore/gnunet-service-datastore.c7
-rw-r--r--src/datastore/perf_datastore_api.c38
-rw-r--r--src/datastore/plugin_datastore_sqlite.c2
4 files changed, 29 insertions, 22 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index f6b5cd609..ef3736950 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -1272,6 +1272,8 @@ process_result_message (void *cls,
1272 ntohl(dm->size), 1272 ntohl(dm->size),
1273 GNUNET_h2s(&dm->key)); 1273 GNUNET_h2s(&dm->key));
1274#endif 1274#endif
1275 if (GNUNET_YES == qe->one_shot)
1276 free_queue_entry (qe);
1275 h->retry_time.rel_value = 0; 1277 h->retry_time.rel_value = 0;
1276 rc.iter (rc.iter_cls, 1278 rc.iter (rc.iter_cls,
1277 &dm->key, 1279 &dm->key,
@@ -1282,8 +1284,6 @@ process_result_message (void *cls,
1282 ntohl(dm->anonymity), 1284 ntohl(dm->anonymity),
1283 GNUNET_TIME_absolute_ntoh(dm->expiration), 1285 GNUNET_TIME_absolute_ntoh(dm->expiration),
1284 GNUNET_ntohll(dm->uid)); 1286 GNUNET_ntohll(dm->uid));
1285 if (GNUNET_YES == qe->one_shot)
1286 free_queue_entry (qe);
1287} 1287}
1288 1288
1289 1289
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index dde63c85f..1a4514a1a 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -540,6 +540,10 @@ transmit_callback (void *cls,
540 tcc->tc (tcc->tc_cls, GNUNET_OK); 540 tcc->tc (tcc->tc_cls, GNUNET_OK);
541 if (GNUNET_YES == tcc->end) 541 if (GNUNET_YES == tcc->end)
542 { 542 {
543#if DEBUG_DATASTORE
544 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
545 "Done processing client request\n");
546#endif
543 GNUNET_SERVER_receive_done (tcc->client, GNUNET_OK); 547 GNUNET_SERVER_receive_done (tcc->client, GNUNET_OK);
544 } 548 }
545 else 549 else
@@ -750,7 +754,8 @@ transmit_item (void *cls,
750 gettext_noop ("# results found"), 754 gettext_noop ("# results found"),
751 1, 755 1,
752 GNUNET_NO); 756 GNUNET_NO);
753 transmit (client, &dm->header, &get_next, next_cls, GNUNET_NO); 757 transmit (client, &dm->header, &get_next, next_cls,
758 (next_cls != NULL) ? GNUNET_NO : GNUNET_YES);
754 return GNUNET_OK; 759 return GNUNET_OK;
755} 760}
756 761
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index be2bc477b..07f856b23 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -226,27 +226,29 @@ run_continuation (void *cls,
226 if (i > 255) 226 if (i > 255)
227 memset (data, i - 255, size / 2); 227 memset (data, i - 255, size / 2);
228 data[0] = k; 228 data[0] = k;
229 GNUNET_DATASTORE_put (datastore, 229 GNUNET_assert (NULL !=
230 0, 230 GNUNET_DATASTORE_put (datastore,
231 &key, 231 0,
232 size, 232 &key,
233 data, 233 size,
234 i+1, 234 data,
235 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100), 235 i+1,
236 i, 0, 236 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100),
237 GNUNET_TIME_relative_to_absolute 237 i, 0,
238 (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 238 GNUNET_TIME_relative_to_absolute
239 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), 239 (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
240 1, 1, TIMEOUT, 240 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
241 &check_success, 241 1, 1, TIMEOUT,
242 crc); 242 &check_success,
243 crc));
243 break; 244 break;
244 case RP_CUT: 245 case RP_CUT:
245 /* trim down below MAX_SIZE again */ 246 /* trim down below MAX_SIZE again */
246 GNUNET_DATASTORE_get_for_replication (datastore, 247 GNUNET_assert (NULL !=
247 1, 1, TIMEOUT, 248 GNUNET_DATASTORE_get_for_replication (datastore,
248 &delete_value, 249 1, 1, TIMEOUT,
249 crc); 250 &delete_value,
251 crc));
250 break; 252 break;
251 case RP_REPORT: 253 case RP_REPORT:
252 printf ( 254 printf (
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index 216d9b7cf..fd10a38cb 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -31,7 +31,7 @@
31/** 31/**
32 * Enable or disable logging debug messages. 32 * Enable or disable logging debug messages.
33 */ 33 */
34#define DEBUG_SQLITE GNUNET_YES 34#define DEBUG_SQLITE GNUNET_NO
35 35
36/** 36/**
37 * We allocate items on the stack at times. To prevent a stack 37 * We allocate items on the stack at times. To prevent a stack