aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-11-13 20:37:37 +0000
committerChristian Grothoff <christian@grothoff.org>2010-11-13 20:37:37 +0000
commitdb6c313c75a36bc4a27971d7bd8da3e938c7c02a (patch)
treeea4dac1648edb33ccafb1b12652236261f538abd /src/hostlist
parent56f7c4934c0d9c18370fdcff5e5a3cd29363d474 (diff)
downloadgnunet-db6c313c75a36bc4a27971d7bd8da3e938c7c02a.tar.gz
gnunet-db6c313c75a36bc4a27971d7bd8da3e938c7c02a.zip
the big core API/protocol change, breaks all testcases using core, since the code is still buggy
Diffstat (limited to 'src/hostlist')
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c20
-rw-r--r--src/hostlist/hostlist-client.c16
-rw-r--r--src/hostlist/hostlist-server.c6
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c11
4 files changed, 21 insertions, 32 deletions
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 8c3bb9be7..bd76b17d3 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -141,13 +141,12 @@ core_init (void *cls,
141 * Core handler for p2p hostlist advertisements 141 * Core handler for p2p hostlist advertisements
142 */ 142 */
143static int advertisement_handler (void *cls, 143static int advertisement_handler (void *cls,
144 const struct GNUNET_PeerIdentity * peer, 144 const struct GNUNET_PeerIdentity * peer,
145 const struct GNUNET_MessageHeader * message, 145 const struct GNUNET_MessageHeader * message,
146 struct GNUNET_TIME_Relative latency, 146 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
147 uint32_t distance)
148{ 147{
149 GNUNET_assert (NULL != client_adv_handler); 148 GNUNET_assert (NULL != client_adv_handler);
150 return (*client_adv_handler) (cls, peer, message, latency, distance); 149 return (*client_adv_handler) (cls, peer, message, atsi);
151} 150}
152 151
153 152
@@ -156,23 +155,21 @@ static int advertisement_handler (void *cls,
156 * 155 *
157 * @param cls closure 156 * @param cls closure
158 * @param peer peer identity this notification is about 157 * @param peer peer identity this notification is about
159 * @param latency reported latency of the connection with 'other' 158 * @param atsi performance data
160 * @param distance reported distance (DV) to 'other'
161 */ 159 */
162static void 160static void
163connect_handler (void *cls, 161connect_handler (void *cls,
164 const struct 162 const struct
165 GNUNET_PeerIdentity * peer, 163 GNUNET_PeerIdentity * peer,
166 struct GNUNET_TIME_Relative latency, 164 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
167 uint32_t distance)
168{ 165{
169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 166 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
170 "A new peer connected, notifying client and server\n"); 167 "A new peer connected, notifying client and server\n");
171 if ( NULL != client_ch) 168 if ( NULL != client_ch)
172 (*client_ch) (cls, peer, latency, distance); 169 (*client_ch) (cls, peer, atsi);
173#if HAVE_MHD 170#if HAVE_MHD
174 if ( NULL != server_ch) 171 if ( NULL != server_ch)
175 (*server_ch) (cls, peer, latency, distance); 172 (*server_ch) (cls, peer, atsi);
176#endif 173#endif
177} 174}
178 175
@@ -270,7 +267,6 @@ run (void *cls,
270 267
271 core = GNUNET_CORE_connect (cfg, 268 core = GNUNET_CORE_connect (cfg,
272 1, 269 1,
273 GNUNET_TIME_UNIT_FOREVER_REL,
274 NULL, 270 NULL,
275 &core_init, 271 &core_init,
276 &connect_handler, &disconnect_handler, NULL, 272 &connect_handler, &disconnect_handler, NULL,
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c
index 9e5cbda65..503adb8a0 100644
--- a/src/hostlist/hostlist-client.c
+++ b/src/hostlist/hostlist-client.c
@@ -1137,15 +1137,13 @@ task_hostlist_saving (void *cls,
1137 * 1137 *
1138 * @param cls closure 1138 * @param cls closure
1139 * @param peer peer identity this notification is about 1139 * @param peer peer identity this notification is about
1140 * @param latency reported latency of the connection with 'other' 1140 * @param atsi performance data
1141 * @param distance reported distance (DV) to 'other'
1142 */ 1141 */
1143static void 1142static void
1144handler_connect (void *cls, 1143handler_connect (void *cls,
1145 const struct 1144 const struct
1146 GNUNET_PeerIdentity * peer, 1145 GNUNET_PeerIdentity * peer,
1147 struct GNUNET_TIME_Relative latency, 1146 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
1148 uint32_t distance)
1149{ 1147{
1150 GNUNET_assert (stat_connection_count < UINT_MAX); 1148 GNUNET_assert (stat_connection_count < UINT_MAX);
1151 stat_connection_count++; 1149 stat_connection_count++;
@@ -1181,17 +1179,15 @@ handler_disconnect (void *cls,
1181 * @param cls closure (always NULL) 1179 * @param cls closure (always NULL)
1182 * @param peer the peer sending the message 1180 * @param peer the peer sending the message
1183 * @param message the actual message 1181 * @param message the actual message
1184 * @param latency latency 1182 * @param atsi performance data
1185 * @param distance distance
1186 * @return GNUNET_OK to keep the connection open, 1183 * @return GNUNET_OK to keep the connection open,
1187 * GNUNET_SYSERR to close it (signal serious error) 1184 * GNUNET_SYSERR to close it (signal serious error)
1188 */ 1185 */
1189static int 1186static int
1190handler_advertisement (void *cls, 1187handler_advertisement (void *cls,
1191 const struct GNUNET_PeerIdentity * peer, 1188 const struct GNUNET_PeerIdentity * peer,
1192 const struct GNUNET_MessageHeader * message, 1189 const struct GNUNET_MessageHeader * message,
1193 struct GNUNET_TIME_Relative latency, 1190 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
1194 uint32_t distance)
1195{ 1191{
1196 size_t size; 1192 size_t size;
1197 size_t uri_size; 1193 size_t uri_size;
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c
index 1c85f8f75..95272a555 100644
--- a/src/hostlist/hostlist-server.c
+++ b/src/hostlist/hostlist-server.c
@@ -376,15 +376,13 @@ adv_transmit_ready ( void *cls, size_t size, void *buf)
376 * 376 *
377 * @param cls closure 377 * @param cls closure
378 * @param peer peer identity this notification is about 378 * @param peer peer identity this notification is about
379 * @param latency reported latency of the connection with 'other' 379 * @param atsi performance data
380 * @param distance reported distance (DV) to 'other'
381 */ 380 */
382static void 381static void
383connect_handler (void *cls, 382connect_handler (void *cls,
384 const struct 383 const struct
385 GNUNET_PeerIdentity * peer, 384 GNUNET_PeerIdentity * peer,
386 struct GNUNET_TIME_Relative latency, 385 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
387 uint32_t distance)
388{ 386{
389 size_t size; 387 size_t size;
390 388
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index d64fdf587..c780c128b 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -283,11 +283,11 @@ check_statistics (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
283/** 283/**
284 * Core handler for p2p hostlist advertisements 284 * Core handler for p2p hostlist advertisements
285 */ 285 */
286static int ad_arrive_handler (void *cls, 286static int
287 const struct GNUNET_PeerIdentity * peer, 287ad_arrive_handler (void *cls,
288 const struct GNUNET_MessageHeader * message, 288 const struct GNUNET_PeerIdentity * peer,
289 struct GNUNET_TIME_Relative latency, 289 const struct GNUNET_MessageHeader * message,
290 uint32_t distance) 290 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
291{ 291{
292 char *hostname; 292 char *hostname;
293 char *expected_uri; 293 char *expected_uri;
@@ -371,7 +371,6 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname)
371 371
372 p->core = GNUNET_CORE_connect (p->cfg, 372 p->core = GNUNET_CORE_connect (p->cfg,
373 1, 373 1,
374 GNUNET_TIME_UNIT_FOREVER_REL,
375 NULL, 374 NULL,
376 NULL, 375 NULL,
377 NULL, NULL, NULL, 376 NULL, NULL, NULL,