diff options
Diffstat (limited to 'src/datastore/plugin_datastore_sqlite.c')
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index 0eba474f6..260bd54cc 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -689,6 +689,7 @@ sqlite_next_request (void *next_cls, | |||
689 | * @param type type of the content | 689 | * @param type type of the content |
690 | * @param priority priority of the content | 690 | * @param priority priority of the content |
691 | * @param anonymity anonymity-level for the content | 691 | * @param anonymity anonymity-level for the content |
692 | * @param replication replication-level for the content | ||
692 | * @param expiration expiration time for the content | 693 | * @param expiration expiration time for the content |
693 | * @param msg set to an error message | 694 | * @param msg set to an error message |
694 | * @return GNUNET_OK on success | 695 | * @return GNUNET_OK on success |
@@ -701,6 +702,7 @@ sqlite_plugin_put (void *cls, | |||
701 | enum GNUNET_BLOCK_Type type, | 702 | enum GNUNET_BLOCK_Type type, |
702 | uint32_t priority, | 703 | uint32_t priority, |
703 | uint32_t anonymity, | 704 | uint32_t anonymity, |
705 | uint32_t replication, | ||
704 | struct GNUNET_TIME_Absolute expiration, | 706 | struct GNUNET_TIME_Absolute expiration, |
705 | char ** msg) | 707 | char ** msg) |
706 | { | 708 | { |
@@ -1532,6 +1534,26 @@ sqlite_plugin_get (void *cls, | |||
1532 | 1534 | ||
1533 | 1535 | ||
1534 | /** | 1536 | /** |
1537 | * Get a random item for replication. Returns a single, not expired, random item | ||
1538 | * from those with the highest replication counters. The item's | ||
1539 | * replication counter is decremented by one IF it was positive before. | ||
1540 | * Call 'iter' with all values ZERO or NULL if the datastore is empty. | ||
1541 | * | ||
1542 | * @param cls closure | ||
1543 | * @param iter function to call the value (once only). | ||
1544 | * @param iter_cls closure for iter | ||
1545 | */ | ||
1546 | static void | ||
1547 | sqlite_plugin_replication_get (void *cls, | ||
1548 | PluginIterator iter, void *iter_cls) | ||
1549 | { | ||
1550 | /* FIXME: not implemented! */ | ||
1551 | iter (iter_cls, NULL, NULL, 0, NULL, 0, 0, 0, | ||
1552 | GNUNET_TIME_UNIT_ZERO_ABS, 0); | ||
1553 | } | ||
1554 | |||
1555 | |||
1556 | /** | ||
1535 | * Drop database. | 1557 | * Drop database. |
1536 | * | 1558 | * |
1537 | * @param cls our plugin context | 1559 | * @param cls our plugin context |
@@ -1623,6 +1645,7 @@ libgnunet_plugin_datastore_sqlite_init (void *cls) | |||
1623 | api->put = &sqlite_plugin_put; | 1645 | api->put = &sqlite_plugin_put; |
1624 | api->next_request = &sqlite_next_request; | 1646 | api->next_request = &sqlite_next_request; |
1625 | api->get = &sqlite_plugin_get; | 1647 | api->get = &sqlite_plugin_get; |
1648 | api->replication_get = &sqlite_plugin_replication_get; | ||
1626 | api->update = &sqlite_plugin_update; | 1649 | api->update = &sqlite_plugin_update; |
1627 | api->iter_low_priority = &sqlite_plugin_iter_low_priority; | 1650 | api->iter_low_priority = &sqlite_plugin_iter_low_priority; |
1628 | api->iter_zero_anonymity = &sqlite_plugin_iter_zero_anonymity; | 1651 | api->iter_zero_anonymity = &sqlite_plugin_iter_zero_anonymity; |