plugin datastore mysql
[oweals/gnunet.git] / src / psycstore / psycstore_api.c
index f378be210487c5e28d12bd023fd0918316e67d10..234218fbaf38ae9418204a52736e97d0dc017e1c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of GNUnet
- * Copyright (C) 2013 Christian Grothoff (and other contributing authors)
+ * Copyright (C) 2013 GNUnet e.V.
  *
  * GNUnet is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -131,7 +131,7 @@ struct GNUNET_PSYCSTORE_Handle
   /**
    * Task doing exponential back-off trying to reconnect.
    */
-  struct GNUNET_SCHEDULER_Task * reconnect_task;
+  struct GNUNET_SCHEDULER_Task *reconnect_task;
 
   /**
    * Time for next connect retry.
@@ -186,10 +186,9 @@ find_op_by_id (struct GNUNET_PSYCSTORE_Handle *h, uint64_t op_id)
  * Try again to connect to the PSYCstore service.
  *
  * @param cls handle to the PSYCstore service.
- * @param tc scheduler context
  */
 static void
-reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+reconnect (void *cls);
 
 
 /**
@@ -531,10 +530,9 @@ transmit_next (struct GNUNET_PSYCSTORE_Handle *h)
  * Try again to connect to the PSYCstore service.
  *
  * @param cls Handle to the PSYCstore service.
- * @param tc Scheduler context.
  */
 static void
-reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+reconnect (void *cls)
 {
   struct GNUNET_PSYCSTORE_Handle *h = cls;
 
@@ -965,6 +963,8 @@ GNUNET_PSYCSTORE_fragment_get_latest (struct GNUNET_PSYCSTORE_Handle *h,
  *        First message ID to retrieve.
  * @param last_message_id
  *        Last consecutive message ID to retrieve.
+ * @param fragment_limit
+ *        Maximum number of fragments to retrieve.
  * @param method_prefix
  *        Retrieve only messages with a matching method prefix.
  * @todo Implement method_prefix query.
@@ -983,6 +983,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
                               const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
                               uint64_t first_message_id,
                               uint64_t last_message_id,
+                              uint64_t fragment_limit,
                               const char *method_prefix,
                               GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -1009,6 +1010,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
   req->channel_key = *channel_key;
   req->first_message_id = GNUNET_htonll (first_message_id);
   req->last_message_id = GNUNET_htonll (last_message_id);
+  req->fragment_limit = GNUNET_htonll (fragment_limit);
   if (NULL != slave_key)
   {
     req->slave_key = *slave_key;
@@ -1299,7 +1301,7 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
                              uint64_t max_state_message_id,
                              uint64_t state_hash_message_id,
                              size_t modifier_count,
-                             const struct GNUNET_ENV_Modifier *modifiers,
+                             const struct GNUNET_PSYC_Modifier *modifiers,
                              GNUNET_PSYCSTORE_ResultCallback rcb,
                              void *rcb_cls)
 {