diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-21 16:03:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-21 16:03:30 +0000 |
commit | a89c7a30d499bac96890929d745fad063eb707b2 (patch) | |
tree | cb001facf8da3cfc9e9bfaa854fb99b9b51ec636 /src | |
parent | d70d18816c37c30e02977a2cc2bdb2368e95a4de (diff) | |
download | gnunet-a89c7a30d499bac96890929d745fad063eb707b2.tar.gz gnunet-a89c7a30d499bac96890929d745fad063eb707b2.zip |
removing deprecated argument in 'init' callback of GNUNET_CORE_connect
Diffstat (limited to 'src')
-rw-r--r-- | src/core/core_api.c | 2 | ||||
-rw-r--r-- | src/core/gnunet-core.c | 11 | ||||
-rw-r--r-- | src/core/test_core_api.c | 4 | ||||
-rw-r--r-- | src/core/test_core_api_reliability.c | 4 | ||||
-rw-r--r-- | src/core/test_core_api_send_to_self.c | 6 | ||||
-rw-r--r-- | src/core/test_core_api_start_only.c | 8 | ||||
-rw-r--r-- | src/core/test_core_quota_compliance.c | 5 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 4 | ||||
-rw-r--r-- | src/dv/gnunet-service-dv.c | 3 | ||||
-rw-r--r-- | src/experimentation/gnunet-daemon-experimentation_nodes.c | 13 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 3 | ||||
-rw-r--r-- | src/hostlist/gnunet-daemon-hostlist.c | 6 | ||||
-rw-r--r-- | src/include/gnunet_core_service.h | 3 | ||||
-rw-r--r-- | src/integration-tests/connection_watchdog.c | 4 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh-enc.c | 7 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 7 | ||||
-rw-r--r-- | src/nse/gnunet-service-nse.c | 5 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_cache.c | 8 | ||||
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 15 |
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 | */ |
74 | static void | 74 | static void |
75 | connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer) | 75 | connected_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 | ||
85 | void | 86 | |
87 | static void | ||
86 | monitor_notify_startup (void *cls, | 88 | monitor_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 | ||
266 | static void | 266 | static void |
267 | init_notify (void *cls, struct GNUNET_CORE_Handle *server, | 267 | init_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 | ||
360 | static void | 360 | static void |
361 | init_notify (void *cls, struct GNUNET_CORE_Handle *server, | 361 | init_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 | ||
105 | static void | 105 | static void |
106 | init (void *cls, struct GNUNET_CORE_Handle *core, | 106 | init (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 | ||
106 | static void | 106 | static void |
107 | init_notify (void *cls, struct GNUNET_CORE_Handle *server, | 107 | init_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 | ||
502 | static void | 502 | static void |
503 | init_notify (void *cls, struct GNUNET_CORE_Handle *server, | 503 | init_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 | */ |
1524 | static void | 1523 | static void |
1525 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 1524 | core_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 | */ |
1807 | static void | 1806 | static void |
1808 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 1807 | core_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 | */ |
178 | static void | 177 | static void |
179 | core_startup_handler (void *cls, | 178 | core_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 | ||
186 | void | 184 | |
185 | static void | ||
187 | schedule_transmisson (struct NodeComCtx *e_ctx); | 186 | schedule_transmisson (struct NodeComCtx *e_ctx); |
188 | 187 | ||
189 | size_t | 188 | |
189 | static size_t | ||
190 | transmit_read_wrapper (void *cls, size_t bufsize, void *buf) | 190 | transmit_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 | ||
210 | void | 210 | |
211 | static void | ||
211 | schedule_transmisson (struct NodeComCtx *e_ctx) | 212 | schedule_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 | */ |
579 | static void | 578 | static void |
580 | peer_init_handler (void *cls, struct GNUNET_CORE_Handle *server, | 579 | peer_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 | ||
130 | static struct GNUNET_PeerIdentity me; | 130 | static struct GNUNET_PeerIdentity me; |
131 | 131 | ||
132 | |||
132 | static void | 133 | static void |
133 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 134 | core_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 | */ |
147 | static int | 149 | static int |
148 | advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer, | 150 | advertisement_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 | */ |
134 | typedef void (*GNUNET_CORE_StartupCallback) (void *cls, | 132 | typedef 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 | ||
950 | static void | 950 | static void |
951 | core_init_cb (void *cls, struct GNUNET_CORE_Handle *server, | 951 | core_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 | */ |
6655 | static void | 6654 | static void |
6656 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 6655 | core_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 | */ |
5625 | static void | 5624 | static void |
5626 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 5625 | core_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 | */ |
1346 | static void | 1345 | static void |
1347 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 1346 | core_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 | */ |
613 | static void | 612 | static void |
614 | core_startup_cb (void *cls, struct GNUNET_CORE_Handle *server, | 613 | core_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 | */ |
979 | static void | 978 | static void |
980 | core_init (void *cls, struct GNUNET_CORE_Handle *server, | 979 | core_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 | ||