gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r28764 - in gnunet/src: core dht dv experimentation fs host


From: gnunet
Subject: [GNUnet-SVN] r28764 - in gnunet/src: core dht dv experimentation fs hostlist include integration-tests mesh nse testbed topology
Date: Wed, 21 Aug 2013 18:03:30 +0200

Author: grothoff
Date: 2013-08-21 18:03:30 +0200 (Wed, 21 Aug 2013)
New Revision: 28764

Modified:
   gnunet/src/core/core_api.c
   gnunet/src/core/gnunet-core.c
   gnunet/src/core/test_core_api.c
   gnunet/src/core/test_core_api_reliability.c
   gnunet/src/core/test_core_api_send_to_self.c
   gnunet/src/core/test_core_api_start_only.c
   gnunet/src/core/test_core_quota_compliance.c
   gnunet/src/dht/gnunet-service-dht_neighbours.c
   gnunet/src/dv/gnunet-service-dv.c
   gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
   gnunet/src/fs/gnunet-service-fs.c
   gnunet/src/hostlist/gnunet-daemon-hostlist.c
   gnunet/src/include/gnunet_core_service.h
   gnunet/src/integration-tests/connection_watchdog.c
   gnunet/src/mesh/gnunet-service-mesh-enc.c
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/nse/gnunet-service-nse.c
   gnunet/src/testbed/gnunet-service-testbed_cache.c
   gnunet/src/topology/gnunet-daemon-topology.c
Log:
removing deprecated argument in 'init' callback of GNUNET_CORE_connect

Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c  2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/core/core_api.c  2013-08-21 16:03:30 UTC (rev 28764)
@@ -782,7 +782,7 @@
       h->init = NULL;
       LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to core service of peer 
`%s'.\n",
            GNUNET_i2s (&h->me));
-      init (h->cls, h, &h->me);
+      init (h->cls, &h->me);
     }
     else
     {

Modified: gnunet/src/core/gnunet-core.c
===================================================================
--- gnunet/src/core/gnunet-core.c       2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/core/gnunet-core.c       2013-08-21 16:03:30 UTC (rev 28764)
@@ -72,7 +72,8 @@
  * @param peer peer identity this notification is about
  */
 static void
-connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer)
+connected_peer_callback (void *cls, 
+                        const struct GNUNET_PeerIdentity *peer)
 {
   struct GNUNET_CRYPTO_HashAsciiEncoded enc;
 
@@ -82,11 +83,10 @@
   printf (_("Peer `%s'\n"), (const char *) &enc);
 }
 
-void
+
+static void
 monitor_notify_startup (void *cls,
-                       struct GNUNET_CORE_Handle * server,
-                       const struct GNUNET_PeerIdentity *
-                       my_identity)
+                       const struct GNUNET_PeerIdentity *my_identity)
 {
   my_id = (*my_identity);
 }
@@ -146,7 +146,6 @@
 }
 
 
-
 /**
  * Main function that will be run by the scheduler.
  *

Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c     2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/core/test_core_api.c     2013-08-21 16:03:30 UTC (rev 28764)
@@ -264,16 +264,14 @@
 
 
 static void
-init_notify (void *cls, struct GNUNET_CORE_Handle *server,
+init_notify (void *cls, 
              const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' 
established\n",
               GNUNET_i2s (my_identity));
-  GNUNET_assert (server != NULL);
   p->id = *my_identity;
-  p->ch = server;
   if (cls == &p1)
   {
     GNUNET_assert (ok == 2);

Modified: gnunet/src/core/test_core_api_reliability.c
===================================================================
--- gnunet/src/core/test_core_api_reliability.c 2013-08-21 15:51:22 UTC (rev 
28763)
+++ gnunet/src/core/test_core_api_reliability.c 2013-08-21 16:03:30 UTC (rev 
28764)
@@ -358,7 +358,7 @@
 
 
 static void
-init_notify (void *cls, struct GNUNET_CORE_Handle *server,
+init_notify (void *cls, 
              const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
@@ -366,9 +366,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Connection to CORE service of `%4s' established\n",
               GNUNET_i2s (my_identity));
-  GNUNET_assert (server != NULL);
   p->id = *my_identity;
-  p->ch = server;
   if (cls == &p1)
   {
     GNUNET_assert (ok == 2);

Modified: gnunet/src/core/test_core_api_send_to_self.c
===================================================================
--- gnunet/src/core/test_core_api_send_to_self.c        2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/core/test_core_api_send_to_self.c        2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -103,12 +103,12 @@
 
 
 static void
-init (void *cls, struct GNUNET_CORE_Handle *core,
+init (void *cls, 
       const struct GNUNET_PeerIdentity *my_identity)
 {
-  if (core == NULL)
+  if (NULL == my_identity)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Could NOT connect to CORE;\n");
+    GNUNET_break (0);
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,

Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c  2013-08-21 15:51:22 UTC (rev 
28763)
+++ gnunet/src/core/test_core_api_start_only.c  2013-08-21 16:03:30 UTC (rev 
28764)
@@ -104,14 +104,12 @@
 
 
 static void
-init_notify (void *cls, struct GNUNET_CORE_Handle *server,
+init_notify (void *cls, 
              const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
-  GNUNET_assert (server != NULL);
-  GNUNET_assert (p->ch == server);
-  if (cls == &p1)
+  if (p == &p1)
   {
     /* connect p2 */
     p2.ch =
@@ -121,7 +119,7 @@
   }
   else
   {
-    GNUNET_assert (cls == &p2);
+    GNUNET_assert (p == &p2);
     GNUNET_SCHEDULER_cancel (timeout_task_id);
     GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
   }

Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c        2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/core/test_core_quota_compliance.c        2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -500,7 +500,7 @@
 
 
 static void
-init_notify (void *cls, struct GNUNET_CORE_Handle *server,
+init_notify (void *cls, 
              const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
@@ -508,9 +508,8 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Connection to CORE service of `%4s' established\n",
               GNUNET_i2s (my_identity));
-  GNUNET_assert (server != NULL);
+  GNUNET_assert (NULL != my_identity);
   p->id = *my_identity;
-  GNUNET_assert (p->ch == server);
   if (cls == &p1)
   {
     GNUNET_assert (ok == 2);

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -1518,14 +1518,12 @@
  * To be called on core init/fail.
  *
  * @param cls service closure
- * @param server handle to the server for this service
  * @param identity the public identity of this peer
  */
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls,
            const struct GNUNET_PeerIdentity *identity)
 {
-  GNUNET_assert (server != NULL);
   my_identity = *identity;
 }
 

Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c   2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/dv/gnunet-service-dv.c   2013-08-21 16:03:30 UTC (rev 28764)
@@ -1801,11 +1801,10 @@
  * Called on core init.
  *
  * @param cls unused
- * @param server legacy
  * @param identity this peer's identity
  */
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls,
            const struct GNUNET_PeerIdentity *identity)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-08-21 16:03:30 UTC (rev 28764)
@@ -172,21 +172,21 @@
  * Core startup callback
  *
  * @param cls unused
- * @param server core service's server handle
  * @param my_identity my id
  */
 static void
 core_startup_handler (void *cls,
-                                                                               
        struct GNUNET_CORE_Handle *server,
                       const struct GNUNET_PeerIdentity *my_identity)
 {
-       me = *my_identity;
+  me = *my_identity;
 }
 
-void
+
+static void
 schedule_transmisson (struct NodeComCtx *e_ctx);
 
-size_t
+
+static size_t
 transmit_read_wrapper (void *cls, size_t bufsize, void *buf)
 {
        struct NodeComCtx *e_ctx = cls;
@@ -207,7 +207,8 @@
        return res;
 }
 
-void
+
+static void
 schedule_transmisson (struct NodeComCtx *e_ctx)
 {
        if (NULL != e_ctx->n->cth)

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/fs/gnunet-service-fs.c   2013-08-21 16:03:30 UTC (rev 28764)
@@ -573,11 +573,10 @@
  * directly (which should work if you are authorized...).
  *
  * @param cls closure
- * @param server handle to the server, NULL if we failed
  * @param my_identity ID of this peer, NULL if we failed
  */
 static void
-peer_init_handler (void *cls, struct GNUNET_CORE_Handle *server,
+peer_init_handler (void *cls,
                    const struct GNUNET_PeerIdentity *my_identity)
 {
   my_id = *my_identity;

Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c        2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c        2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -129,20 +129,22 @@
 
 static struct GNUNET_PeerIdentity me;
 
+
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls,
            const struct GNUNET_PeerIdentity *my_identity)
 {
   me = *my_identity;
 }
 
+
 /**
  * Core handler for p2p hostlist advertisements
  *
  * @param cls closure
  * @param peer identity of the sender
  * @param message advertisement message we got
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
  */
 static int
 advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer,

Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h    2013-08-21 15:51:22 UTC (rev 
28763)
+++ gnunet/src/include/gnunet_core_service.h    2013-08-21 16:03:30 UTC (rev 
28764)
@@ -127,12 +127,9 @@
  * do this later).
  *
  * @param cls closure
- * @param server handle to the server, NULL if we failed;
- *        TODO: consider removing this argument, it is redundant...
  * @param my_identity ID of this peer, NULL if we failed
  */
 typedef void (*GNUNET_CORE_StartupCallback) (void *cls,
-                                             struct GNUNET_CORE_Handle * 
server,
                                              const struct GNUNET_PeerIdentity 
*my_identity);
 
 

Modified: gnunet/src/integration-tests/connection_watchdog.c
===================================================================
--- gnunet/src/integration-tests/connection_watchdog.c  2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/integration-tests/connection_watchdog.c  2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -948,8 +948,8 @@
 }
 
 static void
-core_init_cb (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity)
+core_init_cb (void *cls, 
+             const struct GNUNET_PeerIdentity *my_identity)
 {
   my_peer_id = *my_identity;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to core service\n");

Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-21 15:51:22 UTC (rev 
28763)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-21 16:03:30 UTC (rev 
28764)
@@ -6649,20 +6649,17 @@
  * To be called on core init/fail.
  *
  * @param cls Closure (config)
- * @param server handle to the server for this service
  * @param identity the public identity of this peer
  */
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls, 
            const struct GNUNET_PeerIdentity *identity)
 {
   const struct GNUNET_CONFIGURATION_Handle *c = cls;
   static int i = 0;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core init\n");
-  GNUNET_break (core_handle == server);
-  if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)) ||
-    NULL == server)
+  if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Wrong CORE service\n"));
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2013-08-21 15:51:22 UTC (rev 
28763)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2013-08-21 16:03:30 UTC (rev 
28764)
@@ -5619,20 +5619,17 @@
  * To be called on core init/fail.
  *
  * @param cls Closure (config)
- * @param server handle to the server for this service
  * @param identity the public identity of this peer
  */
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls, 
            const struct GNUNET_PeerIdentity *identity)
 {
   const struct GNUNET_CONFIGURATION_Handle *c = cls;
   static int i = 0;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core init\n");
-  GNUNET_break (core_handle == server);
-  if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)) ||
-    NULL == server)
+  if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Wrong CORE service\n"));
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,

Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2013-08-21 15:51:22 UTC (rev 28763)
+++ gnunet/src/nse/gnunet-service-nse.c 2013-08-21 16:03:30 UTC (rev 28764)
@@ -1340,17 +1340,16 @@
  * Called on core init/fail.
  *
  * @param cls service closure
- * @param server handle to the server for this service
  * @param identity the public identity of this peer
  */
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls, 
            const struct GNUNET_PeerIdentity *identity)
 {
   struct GNUNET_TIME_Absolute now;
   struct GNUNET_TIME_Absolute prev_time;
 
-  if (NULL == server)
+  if (NULL == identity)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Connection to core FAILED!\n");
     GNUNET_SCHEDULER_shutdown ();

Modified: gnunet/src/testbed/gnunet-service-testbed_cache.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_cache.c   2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/testbed/gnunet-service-testbed_cache.c   2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -607,11 +607,10 @@
  * do this later).
  *
  * @param cls closure
- * @param server handle to the server, NULL if we failed
  * @param my_identity ID of this peer, NULL if we failed
  */
 static void
-core_startup_cb (void *cls, struct GNUNET_CORE_Handle *server,
+core_startup_cb (void *cls, 
                  const struct GNUNET_PeerIdentity *my_identity)
 {
   struct CacheEntry *entry = cls;
@@ -622,9 +621,8 @@
     return;
   }
   GNUNET_assert (NULL == entry->peer_identity);
-  GNUNET_break (NULL != server);
-  entry->core_handle = server;
-  entry->peer_identity = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity));
+  // FIXME: why is this dynamically allocated?
+  entry->peer_identity = GNUNET_new (struct GNUNET_PeerIdentity);
   memcpy (entry->peer_identity, my_identity,
           sizeof (struct GNUNET_PeerIdentity));
   if (0 == entry->demand)

Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c        2013-08-21 15:51:22 UTC 
(rev 28763)
+++ gnunet/src/topology/gnunet-daemon-topology.c        2013-08-21 16:03:30 UTC 
(rev 28764)
@@ -969,18 +969,17 @@
 
 
 /**
- * Function called after GNUNET_CORE_connect has succeeded
+ * Function called after #GNUNET_CORE_connect has succeeded
  * (or failed for good).
  *
  * @param cls closure
- * @param server handle to the server, NULL if we failed
  * @param my_id ID of this peer, NULL if we failed
  */
 static void
-core_init (void *cls, struct GNUNET_CORE_Handle *server,
+core_init (void *cls, 
            const struct GNUNET_PeerIdentity *my_id)
 {
-  if (server == NULL)
+  if (NULL == my_id)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _
@@ -988,10 +987,12 @@
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  handle = server;
   my_identity = *my_id;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "I am peer `%s'\n", GNUNET_i2s (my_id));
-  peerinfo_notify = GNUNET_PEERINFO_notify (cfg, GNUNET_NO, &process_peer, 
NULL);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "I am peer `%s'\n", 
+             GNUNET_i2s (my_id));
+  peerinfo_notify = GNUNET_PEERINFO_notify (cfg, GNUNET_NO, 
+                                           &process_peer, NULL);
 }
 
 




reply via email to

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