gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r34685 - gnunet/src/peerstore


From: gnunet
Subject: [GNUnet-SVN] r34685 - gnunet/src/peerstore
Date: Thu, 18 Dec 2014 18:39:01 +0100

Author: otarabai
Date: 2014-12-18 18:39:01 +0100 (Thu, 18 Dec 2014)
New Revision: 34685

Modified:
   gnunet/src/peerstore/gnunet-service-peerstore.c
   gnunet/src/peerstore/peerstore.h
   gnunet/src/peerstore/peerstore_api.c
   gnunet/src/peerstore/peerstore_common.c
   gnunet/src/peerstore/perf_peerstore_store.c
   gnunet/src/peerstore/test_peerstore_api_iterate.c
   gnunet/src/peerstore/test_peerstore_api_store.c
   gnunet/src/peerstore/test_peerstore_api_sync.c
   gnunet/src/peerstore/test_peerstore_api_watch.c
Log:
towards fixing #3581


Modified: gnunet/src/peerstore/gnunet-service-peerstore.c
===================================================================
--- gnunet/src/peerstore/gnunet-service-peerstore.c     2014-12-18 16:22:14 UTC 
(rev 34684)
+++ gnunet/src/peerstore/gnunet-service-peerstore.c     2014-12-18 17:39:01 UTC 
(rev 34685)
@@ -137,7 +137,8 @@
 
 
 /* Forward declaration */
-static void expire_records_continuation (void *cls, int success);
+static void
+expire_records_continuation (void *cls, int success);
 
 
 /**
@@ -152,8 +153,9 @@
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
     return;
   GNUNET_assert (NULL != db);
-  ret = db->expire_records (db->cls, GNUNET_TIME_absolute_get (),
-                            expire_records_continuation, NULL);
+  ret =
+      db->expire_records (db->cls, GNUNET_TIME_absolute_get (),
+                          expire_records_continuation, NULL);
   if (GNUNET_OK != ret)
   {
     GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
@@ -171,7 +173,7 @@
  * @param success count of records deleted or #GNUNET_SYSERR
  */
 static void
-expire_records_continuation(void *cls, int success)
+expire_records_continuation (void *cls, int success)
 {
   if (success > 0)
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%d records expired.\n", success);
@@ -239,8 +241,7 @@
  * @return #GNUNET_YES to continue iteration
  */
 static int
-record_iterator (void *cls,
-                 const struct GNUNET_PEERSTORE_Record *record,
+record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record,
                  const char *emsg)
 {
   struct GNUNET_PEERSTORE_Record *cls_record = cls;
@@ -252,6 +253,7 @@
     struct GNUNET_MessageHeader *endmsg;
 
     endmsg = GNUNET_new (struct GNUNET_MessageHeader);
+
     endmsg->size = htons (sizeof (struct GNUNET_MessageHeader));
     endmsg->type = htons (GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END);
     GNUNET_SERVER_notification_context_unicast (nc, cls_record->client, endmsg,
@@ -463,20 +465,17 @@
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Received a store request (size: %lu).\n"
-              " Sub system `%s'\n"
-              " Peer `%s'\n"
-              " Key `%s'\n"
-              " Value size %lu\n"
-              " Options: %d.\n",
-              record->value_size, record->sub_system, GNUNET_i2s 
(record->peer),
-              record->key, record->value_size, ntohl (srm->options));
+              "Received a store request (size: %lu).\n" " Sub system `%s'\n"
+              " Peer `%s'\n" " Key `%s'\n" " Value size %lu\n"
+              " Options: %d.\n", record->value_size, record->sub_system,
+              GNUNET_i2s (record->peer), record->key, record->value_size,
+              ntohl (srm->options));
   record->client = client;
   if (GNUNET_OK !=
       db->store_record (db->cls, record->sub_system, record->peer, record->key,
                         record->value, record->value_size, *record->expiry,
                         ntohl (srm->options), store_record_continuation,
-                       record))
+                        record))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Failed to store requested value, database error."));

Modified: gnunet/src/peerstore/peerstore.h
===================================================================
--- gnunet/src/peerstore/peerstore.h    2014-12-18 16:22:14 UTC (rev 34684)
+++ gnunet/src/peerstore/peerstore.h    2014-12-18 17:39:01 UTC (rev 34685)
@@ -30,11 +30,10 @@
 
 
 GNUNET_NETWORK_STRUCT_BEGIN
-
 /**
  * Message carrying a PEERSTORE record message
  */
-struct StoreRecordMessage
+    struct StoreRecordMessage
 {
 
   /**
@@ -79,7 +78,8 @@
    * Options, needed only in case of a
    * store operation
    */
-  uint32_t /* enum GNUNET_PEERSTORE_StoreOption */ options GNUNET_PACKED;
+             uint32_t /* enum GNUNET_PEERSTORE_StoreOption */ options
+             GNUNET_PACKED;
 
 };
 

Modified: gnunet/src/peerstore/peerstore_api.c
===================================================================
--- gnunet/src/peerstore/peerstore_api.c        2014-12-18 16:22:14 UTC (rev 
34684)
+++ gnunet/src/peerstore/peerstore_api.c        2014-12-18 17:39:01 UTC (rev 
34685)
@@ -180,6 +180,26 @@
   struct GNUNET_PEERSTORE_Handle *h;
 
   /**
+   * Which subsystem does the store?
+   */
+  char *sub_system;
+
+  /**
+   * Peer the store is for.
+   */
+  struct GNUNET_PeerIdentity peer;
+
+  /**
+   * Key for the store operation.
+   */
+  char *key;
+
+  /**
+   * Operation timeout
+   */
+  struct GNUNET_TIME_Relative timeout;
+
+  /**
    * MQ Envelope with iterate request message
    */
   struct GNUNET_MQ_Envelope *ev;
@@ -311,8 +331,7 @@
 {
   struct GNUNET_PEERSTORE_IterateContext *ic = cls;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Iterate request sent to service.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Iterate request sent to service.\n");
   ic->iterating = GNUNET_YES;
   ic->ev = NULL;
 }
@@ -369,9 +388,7 @@
  * Iterator over previous watches to resend them
  */
 static int
-rewatch_it (void *cls,
-            const struct GNUNET_HashCode *key,
-            void *value)
+rewatch_it (void *cls, const struct GNUNET_HashCode *key, void *value)
 {
   struct GNUNET_PEERSTORE_Handle *h = cls;
   struct GNUNET_PEERSTORE_WatchContext *wc = value;
@@ -390,6 +407,28 @@
 
 
 /**
+ * Called when the iterate request is timedout
+ *
+ * @param cls a `struct GNUNET_PEERSTORE_IterateContext *`
+ * @param tc Scheduler task context (unused)
+ */
+static void
+iterate_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  struct GNUNET_PEERSTORE_IterateContext *ic = cls;
+  GNUNET_PEERSTORE_Processor callback;
+  void *callback_cls;
+
+  ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+  callback = ic->callback;
+  callback_cls = ic->callback_cls;
+  GNUNET_PEERSTORE_iterate_cancel (ic);
+  if (NULL != callback)
+    callback (callback_cls, NULL, _("timeout"));
+}
+
+
+/**
  * Close the existing connection to PEERSTORE and reconnect.
  *
  * @param h handle to the service
@@ -402,8 +441,7 @@
   void *icb_cls;
   struct GNUNET_PEERSTORE_StoreContext *sc;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Reconnecting...\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting...\n");
   for (sc = h->store_head; NULL != sc; sc = sc->next)
   {
     if (NULL != sc->ev)
@@ -430,9 +468,7 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Resending pending requests after reconnect.\n");
   if (NULL != h->watches)
-    GNUNET_CONTAINER_multihashmap_iterate (h->watches,
-                                           &rewatch_it,
-                                           h);
+    GNUNET_CONTAINER_multihashmap_iterate (h->watches, &rewatch_it, h);
   for (ic = h->iterate_head; NULL != ic; ic = ic->next)
   {
     if (GNUNET_YES == ic->iterating)
@@ -441,31 +477,38 @@
       icb_cls = ic->callback_cls;
       GNUNET_PEERSTORE_iterate_cancel (ic);
       if (NULL != icb)
-        icb (icb_cls,
-             NULL,
-             _("Iteration canceled due to reconnection."));
+        icb (icb_cls, NULL, _("Iteration canceled due to reconnection."));
     }
     else
     {
-      GNUNET_MQ_notify_sent (ic->ev,
-                             &iterate_request_sent,
-                             ic);
+      if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task)
+      {
+        GNUNET_SCHEDULER_cancel (ic->timeout_task);
+        ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+      }
+      if (NULL != ic->ev)
+      {
+        GNUNET_MQ_send_cancel (ic->ev);
+        ic->ev = NULL;
+      }
+      ic->ev =
+          PEERSTORE_create_record_mq_envelope (ic->sub_system, &ic->peer,
+                                               ic->key, NULL, 0, NULL, 0,
+                                               
GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE);
+      GNUNET_MQ_notify_sent (ic->ev, &iterate_request_sent, ic);
       GNUNET_MQ_send (h->mq, ic->ev);
+      ic->timeout_task =
+          GNUNET_SCHEDULER_add_delayed (ic->timeout, &iterate_timeout, ic);
     }
   }
   for (sc = h->store_head; NULL != sc; sc = sc->next)
   {
-    sc->ev = PEERSTORE_create_record_mq_envelope (sc->sub_system,
-                                                  &sc->peer,
-                                                  sc->key,
-                                                  sc->value,
-                                                  sc->size,
-                                                  &sc->expiry,
-                                                  sc->options,
-                                                  
GNUNET_MESSAGE_TYPE_PEERSTORE_STORE);
-    GNUNET_MQ_notify_sent (sc->ev,
-                           &store_request_sent,
-                           sc);
+    sc->ev =
+        PEERSTORE_create_record_mq_envelope (sc->sub_system, &sc->peer, 
sc->key,
+                                             sc->value, sc->size, &sc->expiry,
+                                             sc->options,
+                                             
GNUNET_MESSAGE_TYPE_PEERSTORE_STORE);
+    GNUNET_MQ_notify_sent (sc->ev, &store_request_sent, sc);
     GNUNET_MQ_send (h->mq, sc->ev);
   }
 }
@@ -480,9 +523,7 @@
  * @return #GNUNET_YES to continue iteration
  */
 static int
-destroy_watch (void *cls,
-               const struct GNUNET_HashCode *key,
-               void *value)
+destroy_watch (void *cls, const struct GNUNET_HashCode *key, void *value)
 {
   struct GNUNET_PEERSTORE_WatchContext *wc = value;
 
@@ -545,8 +586,7 @@
     GNUNET_free (h);
     return NULL;
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "New connection created\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "New connection created\n");
   return h;
 }
 
@@ -567,13 +607,10 @@
   struct GNUNET_PEERSTORE_StoreContext *sc;
   struct GNUNET_PEERSTORE_StoreContext *sc_iter;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Disconnecting.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting.\n");
   if (NULL != h->watches)
   {
-    GNUNET_CONTAINER_multihashmap_iterate (h->watches,
-                                           &destroy_watch,
-                                           NULL);
+    GNUNET_CONTAINER_multihashmap_iterate (h->watches, &destroy_watch, NULL);
     GNUNET_CONTAINER_multihashmap_destroy (h->watches);
     h->watches = NULL;
   }
@@ -626,15 +663,12 @@
     GNUNET_MQ_send_cancel (sc->ev);
     sc->ev = NULL;
   }
-  GNUNET_CONTAINER_DLL_remove (sc->h->store_head,
-                               sc->h->store_tail,
-                               sc);
+  GNUNET_CONTAINER_DLL_remove (sc->h->store_head, sc->h->store_tail, sc);
   GNUNET_free (sc->sub_system);
   GNUNET_free (sc->value);
   GNUNET_free (sc->key);
   GNUNET_free (sc);
-  if ( (GNUNET_YES == h->disconnecting) &&
-       (NULL == h->store_head) )
+  if ((GNUNET_YES == h->disconnecting) && (NULL == h->store_head))
     do_disconnect (h);
 }
 
@@ -658,14 +692,11 @@
 struct GNUNET_PEERSTORE_StoreContext *
 GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
                         const char *sub_system,
-                        const struct GNUNET_PeerIdentity *peer,
-                        const char *key,
-                        const void *value,
-                        size_t size,
+                        const struct GNUNET_PeerIdentity *peer, const char 
*key,
+                        const void *value, size_t size,
                         struct GNUNET_TIME_Absolute expiry,
                         enum GNUNET_PEERSTORE_StoreOption options,
-                        GNUNET_PEERSTORE_Continuation cont,
-                        void *cont_cls)
+                        GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
 {
   struct GNUNET_MQ_Envelope *ev;
   struct GNUNET_PEERSTORE_StoreContext *sc;
@@ -673,15 +704,11 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Storing value (size: %lu) for subsytem `%s', peer `%s', key `%s'\n",
        size, sub_system, GNUNET_i2s (peer), key);
-  ev = PEERSTORE_create_record_mq_envelope (sub_system,
-                                            peer,
-                                            key,
-                                            value,
-                                            size,
-                                            &expiry,
-                                            options,
+  ev = PEERSTORE_create_record_mq_envelope (sub_system, peer, key, value, size,
+                                            &expiry, options,
                                             
GNUNET_MESSAGE_TYPE_PEERSTORE_STORE);
   sc = GNUNET_new (struct GNUNET_PEERSTORE_StoreContext);
+
   sc->sub_system = GNUNET_strdup (sub_system);
   sc->peer = *peer;
   sc->key = GNUNET_strdup (key);
@@ -693,12 +720,8 @@
   sc->cont_cls = cont_cls;
   sc->h = h;
 
-  GNUNET_CONTAINER_DLL_insert_tail (h->store_head,
-                                    h->store_tail,
-                                    sc);
-  GNUNET_MQ_notify_sent (ev,
-                         &store_request_sent,
-                         sc);
+  GNUNET_CONTAINER_DLL_insert_tail (h->store_head, h->store_tail, sc);
+  GNUNET_MQ_notify_sent (ev, &store_request_sent, sc);
   GNUNET_MQ_send (h->mq, ev);
   return sc;
 
@@ -716,8 +739,7 @@
  * @param msg message received, NULL on timeout or fatal error
  */
 static void
-handle_iterate_result (void *cls,
-                       const struct GNUNET_MessageHeader *msg)
+handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg)
 {
   struct GNUNET_PEERSTORE_Handle *h = cls;
   struct GNUNET_PEERSTORE_IterateContext *ic;
@@ -773,31 +795,6 @@
 
 
 /**
- * Called when the iterate request is timedout
- *
- * @param cls a `struct GNUNET_PEERSTORE_IterateContext *`
- * @param tc Scheduler task context (unused)
- */
-static void
-iterate_timeout (void *cls,
-                 const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
-  struct GNUNET_PEERSTORE_IterateContext *ic = cls;
-  GNUNET_PEERSTORE_Processor callback;
-  void *callback_cls;
-
-  ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
-  callback = ic->callback;
-  callback_cls = ic->callback_cls;
-  GNUNET_PEERSTORE_iterate_cancel (ic);
-  if (NULL != callback)
-    callback (callback_cls,
-              NULL,
-              _("timeout"));
-}
-
-
-/**
  * Cancel an iterate request
  * Please do not call after the iterate request is done
  *
@@ -818,9 +815,10 @@
       GNUNET_MQ_send_cancel (ic->ev);
       ic->ev = NULL;
     }
-    GNUNET_CONTAINER_DLL_remove (ic->h->iterate_head,
-                                 ic->h->iterate_tail,
-                                 ic);
+    GNUNET_CONTAINER_DLL_remove (ic->h->iterate_head, ic->h->iterate_tail, ic);
+    GNUNET_free (ic->sub_system);
+    if (NULL != ic->key)
+      GNUNET_free (ic->key);
     GNUNET_free (ic);
   }
   else
@@ -844,8 +842,7 @@
 GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
                           const char *sub_system,
                           const struct GNUNET_PeerIdentity *peer,
-                          const char *key,
-                          struct GNUNET_TIME_Relative timeout,
+                          const char *key, struct GNUNET_TIME_Relative timeout,
                           GNUNET_PEERSTORE_Processor callback,
                           void *callback_cls)
 {
@@ -861,10 +858,14 @@
   ic->callback_cls = callback_cls;
   ic->ev = ev;
   ic->h = h;
+  ic->sub_system = GNUNET_strdup (sub_system);
+  if (NULL != peer)
+    ic->peer = *peer;
+  if (NULL != key)
+    ic->key = GNUNET_strdup (key);
+  ic->timeout = timeout;
   ic->iterating = GNUNET_NO;
-  GNUNET_CONTAINER_DLL_insert_tail (h->iterate_head,
-                                    h->iterate_tail,
-                                    ic);
+  GNUNET_CONTAINER_DLL_insert_tail (h->iterate_head, h->iterate_tail, ic);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Sending an iterate request for sub system `%s'\n", sub_system);
   GNUNET_MQ_notify_sent (ev, &iterate_request_sent, ic);
@@ -896,12 +897,12 @@
   if (NULL == msg)
   {
     LOG (GNUNET_ERROR_TYPE_ERROR,
-         _("Problem receiving a watch response, no way to determine which 
request.\n"));
+         _
+         ("Problem receiving a watch response, no way to determine which 
request.\n"));
     reconnect (h);
     return;
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Received a watch record from service.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Received a watch record from service.\n");
   record = PEERSTORE_parse_record_message (msg);
   PEERSTORE_hash_key (record->sub_system, record->peer, record->key, &keyhash);
   wc = GNUNET_CONTAINER_multihashmap_get (h->watches, &keyhash);

Modified: gnunet/src/peerstore/peerstore_common.c
===================================================================
--- gnunet/src/peerstore/peerstore_common.c     2014-12-18 16:22:14 UTC (rev 
34684)
+++ gnunet/src/peerstore/peerstore_common.c     2014-12-18 17:39:01 UTC (rev 
34685)
@@ -196,8 +196,8 @@
   if (req_size < sizeof (struct StoreRecordMessage))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-             "Received message with invalid size: (%d < %d).\n",
-             req_size, sizeof (struct StoreRecordMessage));
+                "Received message with invalid size: (%d < %d).\n", req_size,
+                sizeof (struct StoreRecordMessage));
     return NULL;
   }
   srm = (struct StoreRecordMessage *) message;
@@ -208,9 +208,9 @@
       req_size)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-         "Received message with invalid sizes: (%d + %d + %d + %d != %d).\n",
-         ss_size, key_size, value_size, sizeof (struct StoreRecordMessage),
-         req_size);
+                "Received message with invalid sizes: (%d + %d + %d + %d != 
%d).\n",
+                ss_size, key_size, value_size,
+                sizeof (struct StoreRecordMessage), req_size);
     return NULL;
   }
   record = GNUNET_new (struct GNUNET_PEERSTORE_Record);

Modified: gnunet/src/peerstore/perf_peerstore_store.c
===================================================================
--- gnunet/src/peerstore/perf_peerstore_store.c 2014-12-18 16:22:14 UTC (rev 
34684)
+++ gnunet/src/peerstore/perf_peerstore_store.c 2014-12-18 17:39:01 UTC (rev 
34685)
@@ -61,8 +61,7 @@
 
 
 static int
-watch_cb (void *cls,
-          const struct GNUNET_PEERSTORE_Record *record,
+watch_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record,
           const char *emsg)
 {
   GNUNET_assert (NULL == emsg);

Modified: gnunet/src/peerstore/test_peerstore_api_iterate.c
===================================================================
--- gnunet/src/peerstore/test_peerstore_api_iterate.c   2014-12-18 16:22:14 UTC 
(rev 34684)
+++ gnunet/src/peerstore/test_peerstore_api_iterate.c   2014-12-18 17:39:01 UTC 
(rev 34685)
@@ -41,8 +41,7 @@
 
 
 static int
-iter3_cb (void *cls,
-          const struct GNUNET_PEERSTORE_Record *record,
+iter3_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record,
           const char *emsg)
 {
   if (NULL != emsg)
@@ -61,8 +60,7 @@
 
 
 static int
-iter2_cb (void *cls,
-          const struct GNUNET_PEERSTORE_Record *record,
+iter2_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record,
           const char *emsg)
 {
   if (NULL != emsg)
@@ -81,8 +79,7 @@
 
 
 static int
-iter1_cb (void *cls,
-          const struct GNUNET_PEERSTORE_Record *record,
+iter1_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record,
           const char *emsg)
 {
   if (NULL != emsg)

Modified: gnunet/src/peerstore/test_peerstore_api_store.c
===================================================================
--- gnunet/src/peerstore/test_peerstore_api_store.c     2014-12-18 16:22:14 UTC 
(rev 34684)
+++ gnunet/src/peerstore/test_peerstore_api_store.c     2014-12-18 17:39:01 UTC 
(rev 34685)
@@ -40,8 +40,7 @@
 static int count = 0;
 
 static int
-test3_cont2 (void *cls,
-             const struct GNUNET_PEERSTORE_Record *record,
+test3_cont2 (void *cls, const struct GNUNET_PEERSTORE_Record *record,
              const char *emsg)
 {
   if (NULL != emsg)
@@ -86,8 +85,7 @@
 
 
 static int
-test2_cont2 (void *cls,
-             const struct GNUNET_PEERSTORE_Record *record,
+test2_cont2 (void *cls, const struct GNUNET_PEERSTORE_Record *record,
              const char *emsg)
 {
   if (NULL != emsg)
@@ -133,8 +131,7 @@
 
 
 static int
-test1_cont2 (void *cls,
-             const struct GNUNET_PEERSTORE_Record *record,
+test1_cont2 (void *cls, const struct GNUNET_PEERSTORE_Record *record,
              const char *emsg)
 {
   if (NULL != emsg)
@@ -178,8 +175,7 @@
 
 
 static void
-run (void *cls,
-     const struct GNUNET_CONFIGURATION_Handle *cfg,
+run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg,
      struct GNUNET_TESTING_Peer *peer)
 {
   h = GNUNET_PEERSTORE_connect (cfg);

Modified: gnunet/src/peerstore/test_peerstore_api_sync.c
===================================================================
--- gnunet/src/peerstore/test_peerstore_api_sync.c      2014-12-18 16:22:14 UTC 
(rev 34684)
+++ gnunet/src/peerstore/test_peerstore_api_sync.c      2014-12-18 17:39:01 UTC 
(rev 34685)
@@ -38,8 +38,7 @@
 static char *val = "test_peerstore_api_store_val";
 
 static int
-iterate_cb (void *cls,
-            const struct GNUNET_PEERSTORE_Record *record,
+iterate_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record,
             const char *emsg)
 {
   const char *rec_val;

Modified: gnunet/src/peerstore/test_peerstore_api_watch.c
===================================================================
--- gnunet/src/peerstore/test_peerstore_api_watch.c     2014-12-18 16:22:14 UTC 
(rev 34684)
+++ gnunet/src/peerstore/test_peerstore_api_watch.c     2014-12-18 17:39:01 UTC 
(rev 34685)
@@ -36,7 +36,8 @@
 static char *val = "test_peerstore_api_watch_val";
 
 static int
-watch_cb (void *cls, struct GNUNET_PEERSTORE_Record *record, char *emsg)
+watch_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record,
+          const char *emsg)
 {
   GNUNET_assert (NULL == emsg);
   GNUNET_assert (0 == strcmp (val, (char *) record->value));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]