diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-18 20:42:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-18 20:42:29 +0000 |
commit | 0cbe62ab4feb0045c5ec97c5d8c9ca2e552dfcd4 (patch) | |
tree | 17d21672e29a5c1a707bc6d7af398e4338aea62d /src/datastore/datastore_api.c | |
parent | db9027186057d47e586eacdb506bfff04d92fc5a (diff) | |
download | gnunet-0cbe62ab4feb0045c5ec97c5d8c9ca2e552dfcd4.tar.gz gnunet-0cbe62ab4feb0045c5ec97c5d8c9ca2e552dfcd4.zip |
-doxygen, and likely fix for #2727
Diffstat (limited to 'src/datastore/datastore_api.c')
-rw-r--r-- | src/datastore/datastore_api.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 461440c85..00a443fe4 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Christian Grothoff (and other contributing authors) | 3 | (C) 2004-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -381,7 +381,7 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop) | |||
381 | /** | 381 | /** |
382 | * A request has timed out (before being transmitted to the service). | 382 | * A request has timed out (before being transmitted to the service). |
383 | * | 383 | * |
384 | * @param cls the 'struct GNUNET_DATASTORE_QueueEntry' | 384 | * @param cls the `struct GNUNET_DATASTORE_QueueEntry` |
385 | * @param tc scheduler context | 385 | * @param tc scheduler context |
386 | */ | 386 | */ |
387 | static void | 387 | static void |
@@ -394,7 +394,12 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
394 | GNUNET_NO); | 394 | GNUNET_NO); |
395 | qe->task = GNUNET_SCHEDULER_NO_TASK; | 395 | qe->task = GNUNET_SCHEDULER_NO_TASK; |
396 | GNUNET_assert (GNUNET_NO == qe->was_transmitted); | 396 | GNUNET_assert (GNUNET_NO == qe->was_transmitted); |
397 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Timeout of request in datastore queue\n"); | 397 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
398 | "Timeout of request in datastore queue\n"); | ||
399 | /* response_proc's expect request at the head of the queue! */ | ||
400 | GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe); | ||
401 | GNUNET_CONTAINER_DLL_insert (h->queue_head, h->queue_tail, qe); | ||
402 | GNUNET_assert (h->queue_head == qe); | ||
398 | qe->response_proc (qe->h, NULL); | 403 | qe->response_proc (qe->h, NULL); |
399 | } | 404 | } |
400 | 405 | ||
@@ -410,7 +415,7 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
410 | * (if other requests of higher priority are in the queue) | 415 | * (if other requests of higher priority are in the queue) |
411 | * @param timeout timeout for the operation | 416 | * @param timeout timeout for the operation |
412 | * @param response_proc function to call with replies (can be NULL) | 417 | * @param response_proc function to call with replies (can be NULL) |
413 | * @param qc client context (NOT a closure for response_proc) | 418 | * @param qc client context (NOT a closure for @a response_proc) |
414 | * @return NULL if the queue is full | 419 | * @return NULL if the queue is full |
415 | */ | 420 | */ |
416 | static struct GNUNET_DATASTORE_QueueEntry * | 421 | static struct GNUNET_DATASTORE_QueueEntry * |
@@ -472,10 +477,12 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h, size_t msize, | |||
472 | { | 477 | { |
473 | if ((pos->max_queue < h->queue_size) && (pos->was_transmitted == GNUNET_NO)) | 478 | if ((pos->max_queue < h->queue_size) && (pos->was_transmitted == GNUNET_NO)) |
474 | { | 479 | { |
475 | GNUNET_assert (pos->response_proc != NULL); | 480 | GNUNET_assert (NULL != pos->response_proc); |
476 | /* move 'pos' element to head so that it will be | 481 | /* move 'pos' element to head so that it will be |
477 | * killed on 'NULL' call below */ | 482 | * killed on 'NULL' call below */ |
478 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Dropping request from datastore queue\n"); | 483 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
484 | "Dropping request from datastore queue\n"); | ||
485 | /* response_proc's expect request at the head of the queue! */ | ||
479 | GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, pos); | 486 | GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, pos); |
480 | GNUNET_CONTAINER_DLL_insert (h->queue_head, h->queue_tail, pos); | 487 | GNUNET_CONTAINER_DLL_insert (h->queue_head, h->queue_tail, pos); |
481 | GNUNET_STATISTICS_update (h->stats, | 488 | GNUNET_STATISTICS_update (h->stats, |
@@ -1185,7 +1192,7 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1185 | h->retry_time = GNUNET_TIME_UNIT_ZERO; | 1192 | h->retry_time = GNUNET_TIME_UNIT_ZERO; |
1186 | h->result_count = 0; | 1193 | h->result_count = 0; |
1187 | process_queue (h); | 1194 | process_queue (h); |
1188 | if (rc.proc != NULL) | 1195 | if (NULL != rc.proc) |
1189 | rc.proc (rc.proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, | 1196 | rc.proc (rc.proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, |
1190 | 0); | 1197 | 0); |
1191 | return; | 1198 | return; |
@@ -1279,7 +1286,7 @@ GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, | |||
1279 | qe = make_queue_entry (h, sizeof (struct GNUNET_MessageHeader), | 1286 | qe = make_queue_entry (h, sizeof (struct GNUNET_MessageHeader), |
1280 | queue_priority, max_queue_size, timeout, | 1287 | queue_priority, max_queue_size, timeout, |
1281 | &process_result_message, &qc); | 1288 | &process_result_message, &qc); |
1282 | if (qe == NULL) | 1289 | if (NULL == qe) |
1283 | { | 1290 | { |
1284 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1291 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1285 | "Could not create queue entry for GET REPLICATION\n"); | 1292 | "Could not create queue entry for GET REPLICATION\n"); |
@@ -1342,7 +1349,7 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | |||
1342 | qe = make_queue_entry (h, sizeof (struct GetZeroAnonymityMessage), | 1349 | qe = make_queue_entry (h, sizeof (struct GetZeroAnonymityMessage), |
1343 | queue_priority, max_queue_size, timeout, | 1350 | queue_priority, max_queue_size, timeout, |
1344 | &process_result_message, &qc); | 1351 | &process_result_message, &qc); |
1345 | if (qe == NULL) | 1352 | if (NULL == qe) |
1346 | { | 1353 | { |
1347 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1354 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1348 | "Could not create queue entry for zero-anonymity procation\n"); | 1355 | "Could not create queue entry for zero-anonymity procation\n"); |