aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-21 16:03:30 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-21 16:03:30 +0000
commita89c7a30d499bac96890929d745fad063eb707b2 (patch)
treecb001facf8da3cfc9e9bfaa854fb99b9b51ec636
parentd70d18816c37c30e02977a2cc2bdb2368e95a4de (diff)
downloadgnunet-a89c7a30d499bac96890929d745fad063eb707b2.tar.gz
gnunet-a89c7a30d499bac96890929d745fad063eb707b2.zip
removing deprecated argument in 'init' callback of GNUNET_CORE_connect
-rw-r--r--src/core/core_api.c2
-rw-r--r--src/core/gnunet-core.c11
-rw-r--r--src/core/test_core_api.c4
-rw-r--r--src/core/test_core_api_reliability.c4
-rw-r--r--src/core/test_core_api_send_to_self.c6
-rw-r--r--src/core/test_core_api_start_only.c8
-rw-r--r--src/core/test_core_quota_compliance.c5
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c4
-rw-r--r--src/dv/gnunet-service-dv.c3
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_nodes.c13
-rw-r--r--src/fs/gnunet-service-fs.c3
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c6
-rw-r--r--src/include/gnunet_core_service.h3
-rw-r--r--src/integration-tests/connection_watchdog.c4
-rw-r--r--src/mesh/gnunet-service-mesh-enc.c7
-rw-r--r--src/mesh/gnunet-service-mesh.c7
-rw-r--r--src/nse/gnunet-service-nse.c5
-rw-r--r--src/testbed/gnunet-service-testbed_cache.c8
-rw-r--r--src/topology/gnunet-daemon-topology.c15
19 files changed, 49 insertions, 69 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index ccd159d15..2198f7e2c 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -782,7 +782,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
782 h->init = NULL; 782 h->init = NULL;
783 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to core service of peer `%s'.\n", 783 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to core service of peer `%s'.\n",
784 GNUNET_i2s (&h->me)); 784 GNUNET_i2s (&h->me));
785 init (h->cls, h, &h->me); 785 init (h->cls, &h->me);
786 } 786 }
787 else 787 else
788 { 788 {
diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c
index 37f1caec2..9bfd18ec9 100644
--- a/src/core/gnunet-core.c
+++ b/src/core/gnunet-core.c
@@ -72,7 +72,8 @@ shutdown_task (void *cls,
72 * @param peer peer identity this notification is about 72 * @param peer peer identity this notification is about
73 */ 73 */
74static void 74static void
75connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer) 75connected_peer_callback (void *cls,
76 const struct GNUNET_PeerIdentity *peer)
76{ 77{
77 struct GNUNET_CRYPTO_HashAsciiEncoded enc; 78 struct GNUNET_CRYPTO_HashAsciiEncoded enc;
78 79
@@ -82,11 +83,10 @@ connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer)
82 printf (_("Peer `%s'\n"), (const char *) &enc); 83 printf (_("Peer `%s'\n"), (const char *) &enc);
83} 84}
84 85
85void 86
87static void
86monitor_notify_startup (void *cls, 88monitor_notify_startup (void *cls,
87 struct GNUNET_CORE_Handle * server, 89 const struct GNUNET_PeerIdentity *my_identity)
88 const struct GNUNET_PeerIdentity *
89 my_identity)
90{ 90{
91 my_id = (*my_identity); 91 my_id = (*my_identity);
92} 92}
@@ -146,7 +146,6 @@ monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
146} 146}
147 147
148 148
149
150/** 149/**
151 * Main function that will be run by the scheduler. 150 * Main function that will be run by the scheduler.
152 * 151 *
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index 184a64092..348bd8975 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -264,16 +264,14 @@ connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
264 264
265 265
266static void 266static void
267init_notify (void *cls, struct GNUNET_CORE_Handle *server, 267init_notify (void *cls,
268 const struct GNUNET_PeerIdentity *my_identity) 268 const struct GNUNET_PeerIdentity *my_identity)
269{ 269{
270 struct PeerContext *p = cls; 270 struct PeerContext *p = cls;
271 271
272 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' established\n", 272 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' established\n",
273 GNUNET_i2s (my_identity)); 273 GNUNET_i2s (my_identity));
274 GNUNET_assert (server != NULL);
275 p->id = *my_identity; 274 p->id = *my_identity;
276 p->ch = server;
277 if (cls == &p1) 275 if (cls == &p1)
278 { 276 {
279 GNUNET_assert (ok == 2); 277 GNUNET_assert (ok == 2);
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index 29f39585e..e0db5eaed 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -358,7 +358,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
358 358
359 359
360static void 360static void
361init_notify (void *cls, struct GNUNET_CORE_Handle *server, 361init_notify (void *cls,
362 const struct GNUNET_PeerIdentity *my_identity) 362 const struct GNUNET_PeerIdentity *my_identity)
363{ 363{
364 struct PeerContext *p = cls; 364 struct PeerContext *p = cls;
@@ -366,9 +366,7 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
366 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 366 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
367 "Connection to CORE service of `%4s' established\n", 367 "Connection to CORE service of `%4s' established\n",
368 GNUNET_i2s (my_identity)); 368 GNUNET_i2s (my_identity));
369 GNUNET_assert (server != NULL);
370 p->id = *my_identity; 369 p->id = *my_identity;
371 p->ch = server;
372 if (cls == &p1) 370 if (cls == &p1)
373 { 371 {
374 GNUNET_assert (ok == 2); 372 GNUNET_assert (ok == 2);
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index 82048ea92..4e2ee3fe4 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -103,12 +103,12 @@ send_message (void *cls, size_t size, void *buf)
103 103
104 104
105static void 105static void
106init (void *cls, struct GNUNET_CORE_Handle *core, 106init (void *cls,
107 const struct GNUNET_PeerIdentity *my_identity) 107 const struct GNUNET_PeerIdentity *my_identity)
108{ 108{
109 if (core == NULL) 109 if (NULL == my_identity)
110 { 110 {
111 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Could NOT connect to CORE;\n"); 111 GNUNET_break (0);
112 return; 112 return;
113 } 113 }
114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index e98b374d2..ca16eb856 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -104,14 +104,12 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104 104
105 105
106static void 106static void
107init_notify (void *cls, struct GNUNET_CORE_Handle *server, 107init_notify (void *cls,
108 const struct GNUNET_PeerIdentity *my_identity) 108 const struct GNUNET_PeerIdentity *my_identity)
109{ 109{
110 struct PeerContext *p = cls; 110 struct PeerContext *p = cls;
111 111
112 GNUNET_assert (server != NULL); 112 if (p == &p1)
113 GNUNET_assert (p->ch == server);
114 if (cls == &p1)
115 { 113 {
116 /* connect p2 */ 114 /* connect p2 */
117 p2.ch = 115 p2.ch =
@@ -121,7 +119,7 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
121 } 119 }
122 else 120 else
123 { 121 {
124 GNUNET_assert (cls == &p2); 122 GNUNET_assert (p == &p2);
125 GNUNET_SCHEDULER_cancel (timeout_task_id); 123 GNUNET_SCHEDULER_cancel (timeout_task_id);
126 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 124 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
127 } 125 }
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index 9eb4d841f..0078a2daf 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -500,7 +500,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
500 500
501 501
502static void 502static void
503init_notify (void *cls, struct GNUNET_CORE_Handle *server, 503init_notify (void *cls,
504 const struct GNUNET_PeerIdentity *my_identity) 504 const struct GNUNET_PeerIdentity *my_identity)
505{ 505{
506 struct PeerContext *p = cls; 506 struct PeerContext *p = cls;
@@ -508,9 +508,8 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
508 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 508 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
509 "Connection to CORE service of `%4s' established\n", 509 "Connection to CORE service of `%4s' established\n",
510 GNUNET_i2s (my_identity)); 510 GNUNET_i2s (my_identity));
511 GNUNET_assert (server != NULL); 511 GNUNET_assert (NULL != my_identity);
512 p->id = *my_identity; 512 p->id = *my_identity;
513 GNUNET_assert (p->ch == server);
514 if (cls == &p1) 513 if (cls == &p1)
515 { 514 {
516 GNUNET_assert (ok == 2); 515 GNUNET_assert (ok == 2);
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 3041cccfe..349c572b9 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -1518,14 +1518,12 @@ GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target,
1518 * To be called on core init/fail. 1518 * To be called on core init/fail.
1519 * 1519 *
1520 * @param cls service closure 1520 * @param cls service closure
1521 * @param server handle to the server for this service
1522 * @param identity the public identity of this peer 1521 * @param identity the public identity of this peer
1523 */ 1522 */
1524static void 1523static void
1525core_init (void *cls, struct GNUNET_CORE_Handle *server, 1524core_init (void *cls,
1526 const struct GNUNET_PeerIdentity *identity) 1525 const struct GNUNET_PeerIdentity *identity)
1527{ 1526{
1528 GNUNET_assert (server != NULL);
1529 my_identity = *identity; 1527 my_identity = *identity;
1530} 1528}
1531 1529
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 644ffb655..a1ce191cf 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -1801,11 +1801,10 @@ handle_start (void *cls, struct GNUNET_SERVER_Client *client,
1801 * Called on core init. 1801 * Called on core init.
1802 * 1802 *
1803 * @param cls unused 1803 * @param cls unused
1804 * @param server legacy
1805 * @param identity this peer's identity 1804 * @param identity this peer's identity
1806 */ 1805 */
1807static void 1806static void
1808core_init (void *cls, struct GNUNET_CORE_Handle *server, 1807core_init (void *cls,
1809 const struct GNUNET_PeerIdentity *identity) 1808 const struct GNUNET_PeerIdentity *identity)
1810{ 1809{
1811 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1810 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/experimentation/gnunet-daemon-experimentation_nodes.c b/src/experimentation/gnunet-daemon-experimentation_nodes.c
index 0590a1dec..14d25b6c9 100644
--- a/src/experimentation/gnunet-daemon-experimentation_nodes.c
+++ b/src/experimentation/gnunet-daemon-experimentation_nodes.c
@@ -172,21 +172,21 @@ static int is_me (const struct GNUNET_PeerIdentity *id)
172 * Core startup callback 172 * Core startup callback
173 * 173 *
174 * @param cls unused 174 * @param cls unused
175 * @param server core service's server handle
176 * @param my_identity my id 175 * @param my_identity my id
177 */ 176 */
178static void 177static void
179core_startup_handler (void *cls, 178core_startup_handler (void *cls,
180 struct GNUNET_CORE_Handle *server,
181 const struct GNUNET_PeerIdentity *my_identity) 179 const struct GNUNET_PeerIdentity *my_identity)
182{ 180{
183 me = *my_identity; 181 me = *my_identity;
184} 182}
185 183
186void 184
185static void
187schedule_transmisson (struct NodeComCtx *e_ctx); 186schedule_transmisson (struct NodeComCtx *e_ctx);
188 187
189size_t 188
189static size_t
190transmit_read_wrapper (void *cls, size_t bufsize, void *buf) 190transmit_read_wrapper (void *cls, size_t bufsize, void *buf)
191{ 191{
192 struct NodeComCtx *e_ctx = cls; 192 struct NodeComCtx *e_ctx = cls;
@@ -207,7 +207,8 @@ transmit_read_wrapper (void *cls, size_t bufsize, void *buf)
207 return res; 207 return res;
208} 208}
209 209
210void 210
211static void
211schedule_transmisson (struct NodeComCtx *e_ctx) 212schedule_transmisson (struct NodeComCtx *e_ctx)
212{ 213{
213 if (NULL != e_ctx->n->cth) 214 if (NULL != e_ctx->n->cth)
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index a8fbda84b..8ecb6bb67 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -573,11 +573,10 @@ peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer)
573 * directly (which should work if you are authorized...). 573 * directly (which should work if you are authorized...).
574 * 574 *
575 * @param cls closure 575 * @param cls closure
576 * @param server handle to the server, NULL if we failed
577 * @param my_identity ID of this peer, NULL if we failed 576 * @param my_identity ID of this peer, NULL if we failed
578 */ 577 */
579static void 578static void
580peer_init_handler (void *cls, struct GNUNET_CORE_Handle *server, 579peer_init_handler (void *cls,
581 const struct GNUNET_PeerIdentity *my_identity) 580 const struct GNUNET_PeerIdentity *my_identity)
582{ 581{
583 my_id = *my_identity; 582 my_id = *my_identity;
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index f5ea6bba7..c3543027a 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -129,20 +129,22 @@ GNUNET_NETWORK_STRUCT_END
129 129
130static struct GNUNET_PeerIdentity me; 130static struct GNUNET_PeerIdentity me;
131 131
132
132static void 133static void
133core_init (void *cls, struct GNUNET_CORE_Handle *server, 134core_init (void *cls,
134 const struct GNUNET_PeerIdentity *my_identity) 135 const struct GNUNET_PeerIdentity *my_identity)
135{ 136{
136 me = *my_identity; 137 me = *my_identity;
137} 138}
138 139
140
139/** 141/**
140 * Core handler for p2p hostlist advertisements 142 * Core handler for p2p hostlist advertisements
141 * 143 *
142 * @param cls closure 144 * @param cls closure
143 * @param peer identity of the sender 145 * @param peer identity of the sender
144 * @param message advertisement message we got 146 * @param message advertisement message we got
145 * @return GNUNET_OK on success 147 * @return #GNUNET_OK on success
146 */ 148 */
147static int 149static int
148advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 150advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h
index ea8391d4e..7fc77d094 100644
--- a/src/include/gnunet_core_service.h
+++ b/src/include/gnunet_core_service.h
@@ -127,12 +127,9 @@ struct GNUNET_CORE_MessageHandler
127 * do this later). 127 * do this later).
128 * 128 *
129 * @param cls closure 129 * @param cls closure
130 * @param server handle to the server, NULL if we failed;
131 * TODO: consider removing this argument, it is redundant...
132 * @param my_identity ID of this peer, NULL if we failed 130 * @param my_identity ID of this peer, NULL if we failed
133 */ 131 */
134typedef void (*GNUNET_CORE_StartupCallback) (void *cls, 132typedef void (*GNUNET_CORE_StartupCallback) (void *cls,
135 struct GNUNET_CORE_Handle * server,
136 const struct GNUNET_PeerIdentity *my_identity); 133 const struct GNUNET_PeerIdentity *my_identity);
137 134
138 135
diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c
index 5bfe39e9a..9010044cc 100644
--- a/src/integration-tests/connection_watchdog.c
+++ b/src/integration-tests/connection_watchdog.c
@@ -948,8 +948,8 @@ core_disconnect_cb (void *cls,
948} 948}
949 949
950static void 950static void
951core_init_cb (void *cls, struct GNUNET_CORE_Handle *server, 951core_init_cb (void *cls,
952 const struct GNUNET_PeerIdentity *my_identity) 952 const struct GNUNET_PeerIdentity *my_identity)
953{ 953{
954 my_peer_id = *my_identity; 954 my_peer_id = *my_identity;
955 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to core service\n"); 955 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to core service\n");
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c
index d770490b3..510a08d14 100644
--- a/src/mesh/gnunet-service-mesh-enc.c
+++ b/src/mesh/gnunet-service-mesh-enc.c
@@ -6649,20 +6649,17 @@ server_init (void)
6649 * To be called on core init/fail. 6649 * To be called on core init/fail.
6650 * 6650 *
6651 * @param cls Closure (config) 6651 * @param cls Closure (config)
6652 * @param server handle to the server for this service
6653 * @param identity the public identity of this peer 6652 * @param identity the public identity of this peer
6654 */ 6653 */
6655static void 6654static void
6656core_init (void *cls, struct GNUNET_CORE_Handle *server, 6655core_init (void *cls,
6657 const struct GNUNET_PeerIdentity *identity) 6656 const struct GNUNET_PeerIdentity *identity)
6658{ 6657{
6659 const struct GNUNET_CONFIGURATION_Handle *c = cls; 6658 const struct GNUNET_CONFIGURATION_Handle *c = cls;
6660 static int i = 0; 6659 static int i = 0;
6661 6660
6662 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core init\n"); 6661 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core init\n");
6663 GNUNET_break (core_handle == server); 6662 if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)))
6664 if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)) ||
6665 NULL == server)
6666 { 6663 {
6667 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Wrong CORE service\n")); 6664 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Wrong CORE service\n"));
6668 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 6665 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 1893c2304..130c7df14 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -5619,20 +5619,17 @@ server_init (void)
5619 * To be called on core init/fail. 5619 * To be called on core init/fail.
5620 * 5620 *
5621 * @param cls Closure (config) 5621 * @param cls Closure (config)
5622 * @param server handle to the server for this service
5623 * @param identity the public identity of this peer 5622 * @param identity the public identity of this peer
5624 */ 5623 */
5625static void 5624static void
5626core_init (void *cls, struct GNUNET_CORE_Handle *server, 5625core_init (void *cls,
5627 const struct GNUNET_PeerIdentity *identity) 5626 const struct GNUNET_PeerIdentity *identity)
5628{ 5627{
5629 const struct GNUNET_CONFIGURATION_Handle *c = cls; 5628 const struct GNUNET_CONFIGURATION_Handle *c = cls;
5630 static int i = 0; 5629 static int i = 0;
5631 5630
5632 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core init\n"); 5631 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core init\n");
5633 GNUNET_break (core_handle == server); 5632 if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)))
5634 if (0 != memcmp (identity, &my_full_id, sizeof (my_full_id)) ||
5635 NULL == server)
5636 { 5633 {
5637 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Wrong CORE service\n")); 5634 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Wrong CORE service\n"));
5638 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 5635 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index b26305ce3..7aabca6b5 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -1340,17 +1340,16 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1340 * Called on core init/fail. 1340 * Called on core init/fail.
1341 * 1341 *
1342 * @param cls service closure 1342 * @param cls service closure
1343 * @param server handle to the server for this service
1344 * @param identity the public identity of this peer 1343 * @param identity the public identity of this peer
1345 */ 1344 */
1346static void 1345static void
1347core_init (void *cls, struct GNUNET_CORE_Handle *server, 1346core_init (void *cls,
1348 const struct GNUNET_PeerIdentity *identity) 1347 const struct GNUNET_PeerIdentity *identity)
1349{ 1348{
1350 struct GNUNET_TIME_Absolute now; 1349 struct GNUNET_TIME_Absolute now;
1351 struct GNUNET_TIME_Absolute prev_time; 1350 struct GNUNET_TIME_Absolute prev_time;
1352 1351
1353 if (NULL == server) 1352 if (NULL == identity)
1354 { 1353 {
1355 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Connection to core FAILED!\n"); 1354 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Connection to core FAILED!\n");
1356 GNUNET_SCHEDULER_shutdown (); 1355 GNUNET_SCHEDULER_shutdown ();
diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c
index c50288f2d..8cae56076 100644
--- a/src/testbed/gnunet-service-testbed_cache.c
+++ b/src/testbed/gnunet-service-testbed_cache.c
@@ -607,11 +607,10 @@ oprelease_get_handle_transport (void *cls)
607 * do this later). 607 * do this later).
608 * 608 *
609 * @param cls closure 609 * @param cls closure
610 * @param server handle to the server, NULL if we failed
611 * @param my_identity ID of this peer, NULL if we failed 610 * @param my_identity ID of this peer, NULL if we failed
612 */ 611 */
613static void 612static void
614core_startup_cb (void *cls, struct GNUNET_CORE_Handle *server, 613core_startup_cb (void *cls,
615 const struct GNUNET_PeerIdentity *my_identity) 614 const struct GNUNET_PeerIdentity *my_identity)
616{ 615{
617 struct CacheEntry *entry = cls; 616 struct CacheEntry *entry = cls;
@@ -622,9 +621,8 @@ core_startup_cb (void *cls, struct GNUNET_CORE_Handle *server,
622 return; 621 return;
623 } 622 }
624 GNUNET_assert (NULL == entry->peer_identity); 623 GNUNET_assert (NULL == entry->peer_identity);
625 GNUNET_break (NULL != server); 624 // FIXME: why is this dynamically allocated?
626 entry->core_handle = server; 625 entry->peer_identity = GNUNET_new (struct GNUNET_PeerIdentity);
627 entry->peer_identity = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity));
628 memcpy (entry->peer_identity, my_identity, 626 memcpy (entry->peer_identity, my_identity,
629 sizeof (struct GNUNET_PeerIdentity)); 627 sizeof (struct GNUNET_PeerIdentity));
630 if (0 == entry->demand) 628 if (0 == entry->demand)
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 6687ee02a..372659bbc 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -969,18 +969,17 @@ process_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
969 969
970 970
971/** 971/**
972 * Function called after GNUNET_CORE_connect has succeeded 972 * Function called after #GNUNET_CORE_connect has succeeded
973 * (or failed for good). 973 * (or failed for good).
974 * 974 *
975 * @param cls closure 975 * @param cls closure
976 * @param server handle to the server, NULL if we failed
977 * @param my_id ID of this peer, NULL if we failed 976 * @param my_id ID of this peer, NULL if we failed
978 */ 977 */
979static void 978static void
980core_init (void *cls, struct GNUNET_CORE_Handle *server, 979core_init (void *cls,
981 const struct GNUNET_PeerIdentity *my_id) 980 const struct GNUNET_PeerIdentity *my_id)
982{ 981{
983 if (server == NULL) 982 if (NULL == my_id)
984 { 983 {
985 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 984 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
986 _ 985 _
@@ -988,10 +987,12 @@ core_init (void *cls, struct GNUNET_CORE_Handle *server,
988 GNUNET_SCHEDULER_shutdown (); 987 GNUNET_SCHEDULER_shutdown ();
989 return; 988 return;
990 } 989 }
991 handle = server;
992 my_identity = *my_id; 990 my_identity = *my_id;
993 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "I am peer `%s'\n", GNUNET_i2s (my_id)); 991 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
994 peerinfo_notify = GNUNET_PEERINFO_notify (cfg, GNUNET_NO, &process_peer, NULL); 992 "I am peer `%s'\n",
993 GNUNET_i2s (my_id));
994 peerinfo_notify = GNUNET_PEERINFO_notify (cfg, GNUNET_NO,
995 &process_peer, NULL);
995} 996}
996 997
997 998