diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-30 17:33:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-30 17:33:48 +0000 |
commit | f87f930cb42261aa3890ed40aff78f9a009c6e18 (patch) | |
tree | 94751c2990465d096ab587fc818aed66ff928e5f | |
parent | 24dc89edc8d7f9eb5f23cd3e804fd9732858fbee (diff) | |
download | gnunet-f87f930cb42261aa3890ed40aff78f9a009c6e18.tar.gz gnunet-f87f930cb42261aa3890ed40aff78f9a009c6e18.zip |
convert to new hello_get API
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist.c | 14 | ||||
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_reconnect.c | 14 |
2 files changed, 16 insertions, 12 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index 9a1e6d3d7..eb4a85115 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "gnunet_arm_service.h" | 27 | #include "gnunet_arm_service.h" |
28 | #include "gnunet_transport_service.h" | 28 | #include "gnunet_transport_service.h" |
29 | #include "gnunet_transport_core_service.h" | 29 | #include "gnunet_transport_core_service.h" |
30 | #include "gnunet_transport_hello_service.h" | ||
30 | 31 | ||
31 | 32 | ||
32 | /** | 33 | /** |
@@ -43,7 +44,7 @@ struct PeerContext | |||
43 | struct GNUNET_CONFIGURATION_Handle *cfg; | 44 | struct GNUNET_CONFIGURATION_Handle *cfg; |
44 | struct GNUNET_TRANSPORT_CoreHandle *th; | 45 | struct GNUNET_TRANSPORT_CoreHandle *th; |
45 | struct GNUNET_MessageHeader *hello; | 46 | struct GNUNET_MessageHeader *hello; |
46 | struct GNUNET_TRANSPORT_GetHelloHandle *ghh; | 47 | struct GNUNET_TRANSPORT_HelloGetHandle *ghh; |
47 | struct GNUNET_OS_Process *arm_proc; | 48 | struct GNUNET_OS_Process *arm_proc; |
48 | }; | 49 | }; |
49 | 50 | ||
@@ -59,7 +60,7 @@ clean_up (void *cls) | |||
59 | { | 60 | { |
60 | if (NULL != p1.ghh) | 61 | if (NULL != p1.ghh) |
61 | { | 62 | { |
62 | GNUNET_TRANSPORT_get_hello_cancel (p1.ghh); | 63 | GNUNET_TRANSPORT_hello_get_cancel (p1.ghh); |
63 | p1.ghh = NULL; | 64 | p1.ghh = NULL; |
64 | } | 65 | } |
65 | GNUNET_TRANSPORT_core_disconnect (p1.th); | 66 | GNUNET_TRANSPORT_core_disconnect (p1.th); |
@@ -69,7 +70,7 @@ clean_up (void *cls) | |||
69 | { | 70 | { |
70 | if (NULL != p2.ghh) | 71 | if (NULL != p2.ghh) |
71 | { | 72 | { |
72 | GNUNET_TRANSPORT_get_hello_cancel (p2.ghh); | 73 | GNUNET_TRANSPORT_hello_get_cancel (p2.ghh); |
73 | p2.ghh = NULL; | 74 | p2.ghh = NULL; |
74 | } | 75 | } |
75 | GNUNET_TRANSPORT_core_disconnect (p2.th); | 76 | GNUNET_TRANSPORT_core_disconnect (p2.th); |
@@ -125,7 +126,7 @@ process_hello (void *cls, | |||
125 | { | 126 | { |
126 | struct PeerContext *p = cls; | 127 | struct PeerContext *p = cls; |
127 | 128 | ||
128 | GNUNET_TRANSPORT_get_hello_cancel (p->ghh); | 129 | GNUNET_TRANSPORT_hello_get_cancel (p->ghh); |
129 | p->ghh = NULL; | 130 | p->ghh = NULL; |
130 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 131 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
131 | "Received HELLO, starting hostlist service.\n"); | 132 | "Received HELLO, starting hostlist service.\n"); |
@@ -161,8 +162,9 @@ setup_peer (struct PeerContext *p, | |||
161 | ¬ify_connect, | 162 | ¬ify_connect, |
162 | NULL, | 163 | NULL, |
163 | NULL); | 164 | NULL); |
164 | GNUNET_assert (p->th != NULL); | 165 | GNUNET_assert (NULL != p->th); |
165 | p->ghh = GNUNET_TRANSPORT_get_hello (p->cfg, | 166 | p->ghh = GNUNET_TRANSPORT_hello_get (p->cfg, |
167 | GNUNET_TRANSPORT_AC_ANY, | ||
166 | &process_hello, | 168 | &process_hello, |
167 | p); | 169 | p); |
168 | GNUNET_free (binary); | 170 | GNUNET_free (binary); |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index e0c193ed3..2ebc780a7 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | #include "gnunet_arm_service.h" | 28 | #include "gnunet_arm_service.h" |
29 | #include "gnunet_transport_core_service.h" | 29 | #include "gnunet_transport_core_service.h" |
30 | #include "gnunet_transport_hello_service.h" | ||
30 | 31 | ||
31 | /** | 32 | /** |
32 | * How long until we give up on transmitting the message? | 33 | * How long until we give up on transmitting the message? |
@@ -42,7 +43,7 @@ struct PeerContext | |||
42 | struct GNUNET_CONFIGURATION_Handle *cfg; | 43 | struct GNUNET_CONFIGURATION_Handle *cfg; |
43 | struct GNUNET_TRANSPORT_CoreHandle *th; | 44 | struct GNUNET_TRANSPORT_CoreHandle *th; |
44 | struct GNUNET_MessageHeader *hello; | 45 | struct GNUNET_MessageHeader *hello; |
45 | struct GNUNET_TRANSPORT_GetHelloHandle *ghh; | 46 | struct GNUNET_TRANSPORT_HelloGetHandle *ghh; |
46 | struct GNUNET_OS_Process *arm_proc; | 47 | struct GNUNET_OS_Process *arm_proc; |
47 | }; | 48 | }; |
48 | 49 | ||
@@ -73,7 +74,7 @@ timeout_error (void *cls) | |||
73 | * @param mq message queue to send to @a peer | 74 | * @param mq message queue to send to @a peer |
74 | * @return NULL | 75 | * @return NULL |
75 | */ | 76 | */ |
76 | static void | 77 | static void * |
77 | notify_connect (void *cls, | 78 | notify_connect (void *cls, |
78 | const struct GNUNET_PeerIdentity *peer, | 79 | const struct GNUNET_PeerIdentity *peer, |
79 | struct GNUNET_MQ_Handle *mq) | 80 | struct GNUNET_MQ_Handle *mq) |
@@ -92,7 +93,7 @@ process_hello (void *cls, | |||
92 | { | 93 | { |
93 | struct PeerContext *p = cls; | 94 | struct PeerContext *p = cls; |
94 | 95 | ||
95 | GNUNET_TRANSPORT_get_hello_cancel (p->ghh); | 96 | GNUNET_TRANSPORT_hello_get_cancel (p->ghh); |
96 | p->ghh = NULL; | 97 | p->ghh = NULL; |
97 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 98 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
98 | "Received HELLO, starting hostlist service.\n"); | 99 | "Received HELLO, starting hostlist service.\n"); |
@@ -129,7 +130,8 @@ setup_peer (struct PeerContext *p, | |||
129 | NULL, | 130 | NULL, |
130 | NULL); | 131 | NULL); |
131 | GNUNET_assert (NULL != p->th); | 132 | GNUNET_assert (NULL != p->th); |
132 | p->ghh = GNUNET_TRANSPORT_get_hello (p->cfg, | 133 | p->ghh = GNUNET_TRANSPORT_hello_get (p->cfg, |
134 | GNUNET_TRANSPORT_AC_ANY, | ||
133 | &process_hello, | 135 | &process_hello, |
134 | p); | 136 | p); |
135 | GNUNET_free (binary); | 137 | GNUNET_free (binary); |
@@ -184,7 +186,7 @@ shutdown_task (void *cls) | |||
184 | } | 186 | } |
185 | if (NULL != p1.ghh) | 187 | if (NULL != p1.ghh) |
186 | { | 188 | { |
187 | GNUNET_TRANSPORT_get_hello_cancel (p1.ghh); | 189 | GNUNET_TRANSPORT_hello_get_cancel (p1.ghh); |
188 | p1.ghh = NULL; | 190 | p1.ghh = NULL; |
189 | } | 191 | } |
190 | if (NULL != p1.th) | 192 | if (NULL != p1.th) |
@@ -194,7 +196,7 @@ shutdown_task (void *cls) | |||
194 | } | 196 | } |
195 | if (NULL != p2.ghh) | 197 | if (NULL != p2.ghh) |
196 | { | 198 | { |
197 | GNUNET_TRANSPORT_get_hello_cancel (p2.ghh); | 199 | GNUNET_TRANSPORT_hello_get_cancel (p2.ghh); |
198 | p2.ghh = NULL; | 200 | p2.ghh = NULL; |
199 | } | 201 | } |
200 | if (NULL != p2.th) | 202 | if (NULL != p2.th) |