gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25302 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r25302 - gnunet/src/mesh
Date: Thu, 6 Dec 2012 17:26:18 +0100

Author: bartpolot
Date: 2012-12-06 17:26:18 +0100 (Thu, 06 Dec 2012)
New Revision: 25302

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- fixed #2675

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-12-06 16:06:23 UTC (rev 
25301)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-12-06 16:26:18 UTC (rev 
25302)
@@ -8602,7 +8602,7 @@
 /**
  * Callback for hostkey read/generation
  *
- * @param cls NULL
+ * @param cls Closure (Configuration handle).
  * @param pk the private key
  * @param emsg error message
  */
@@ -8611,6 +8611,7 @@
                    struct GNUNET_CRYPTO_RsaPrivateKey *pk,
                    const char *emsg)
 {
+  const struct GNUNET_CONFIGURATION_Handle *c = cls;
   struct MeshPeerInfo *peer;
   struct MeshPeerPath *p;
 
@@ -8639,8 +8640,24 @@
 //                                               NULL,
 //                                               NULL);
 
+  core_handle = GNUNET_CORE_connect (c, /* Main configuration */
+                                     NULL,      /* Closure passed to MESH 
functions */
+                                     &core_init,        /* Call core_init once 
connected */
+                                     &core_connect,     /* Handle connects */
+                                     &core_disconnect,  /* remove peers on 
disconnects */
+                                     NULL,      /* Don't notify about all 
incoming messages */
+                                     GNUNET_NO, /* For header only in 
notification */
+                                     NULL,      /* Don't notify about all 
outbound messages */
+                                     GNUNET_NO, /* For header-only out 
notification */
+                                     core_handlers);    /* Register these 
handlers */
+  
+  if (core_handle == NULL)
+  {
+    GNUNET_break (0);
+    GNUNET_SCHEDULER_shutdown ();
+    return;
+  }
 
-
   next_tid = 0;
   next_local_tid = GNUNET_MESH_LOCAL_TUNNEL_ID_SERV;
 
@@ -8684,24 +8701,7 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting to run\n");
   server_handle = server;
-  core_handle = GNUNET_CORE_connect (c, /* Main configuration */
-                                     NULL,      /* Closure passed to MESH 
functions */
-                                     &core_init,        /* Call core_init once 
connected */
-                                     &core_connect,     /* Handle connects */
-                                     &core_disconnect,  /* remove peers on 
disconnects */
-                                     NULL,      /* Don't notify about all 
incoming messages */
-                                     GNUNET_NO, /* For header only in 
notification */
-                                     NULL,      /* Don't notify about all 
outbound messages */
-                                     GNUNET_NO, /* For header-only out 
notification */
-                                     core_handlers);    /* Register these 
handlers */
 
-  if (core_handle == NULL)
-  {
-    GNUNET_break (0);
-    GNUNET_SCHEDULER_shutdown ();
-    return;
-  }
-
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (c, "GNUNETD", "HOSTKEY",
                                                &keyfile))
@@ -8827,7 +8827,9 @@
   /* Scheduled the task to clean up when shutdown is called */
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
-  keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile, &key_generation_cb, 
NULL);
+  keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile,
+                                               &key_generation_cb,
+                                               (void *) c);
   GNUNET_free (keyfile);
 }
 




reply via email to

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