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/core | |
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/core')
-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 |
7 files changed, 16 insertions, 24 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); |