diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-05 13:22:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-05 13:22:58 +0000 |
commit | 1fb197c7605c2a8a28cd83d67ccd28af089c7f84 (patch) | |
tree | 4c2ab709b8e70a1feca80dcc2d6a1410c40426e4 /src/topology | |
parent | 1e1ec14461361419b17e1933a3ac766b2e7ecec9 (diff) | |
download | gnunet-1fb197c7605c2a8a28cd83d67ccd28af089c7f84.tar.gz gnunet-1fb197c7605c2a8a28cd83d67ccd28af089c7f84.zip |
tell transport to connect, not core
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 55ee36fd2..6f55419d9 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -89,12 +89,6 @@ struct Peer | |||
89 | struct GNUNET_CORE_TransmitHandle *hello_req; | 89 | struct GNUNET_CORE_TransmitHandle *hello_req; |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Our handle for the request to connect to this peer; NULL if no | ||
93 | * such request is pending. | ||
94 | */ | ||
95 | struct GNUNET_CORE_PeerRequestHandle *connect_req; | ||
96 | |||
97 | /** | ||
98 | * Pointer to the HELLO message of this peer; can be NULL. | 92 | * Pointer to the HELLO message of this peer; can be NULL. |
99 | */ | 93 | */ |
100 | struct GNUNET_HELLO_Message *hello; | 94 | struct GNUNET_HELLO_Message *hello; |
@@ -269,21 +263,6 @@ whitelist_peers () | |||
269 | 263 | ||
270 | 264 | ||
271 | /** | 265 | /** |
272 | * Function called by core when our request to connect was transmitted. | ||
273 | * | ||
274 | * @param cls the 'struct Peer' for which we issued the connect request | ||
275 | * @param success was the request transmitted | ||
276 | */ | ||
277 | static void | ||
278 | connect_completed_callback (void *cls, int success) | ||
279 | { | ||
280 | struct Peer *pos = cls; | ||
281 | |||
282 | pos->connect_req = NULL; | ||
283 | } | ||
284 | |||
285 | |||
286 | /** | ||
287 | * Check if an additional connection from the given peer is allowed. | 266 | * Check if an additional connection from the given peer is allowed. |
288 | * | 267 | * |
289 | * @param peer connection to check | 268 | * @param peer connection to check |
@@ -334,8 +313,6 @@ free_peer (void *cls, const GNUNET_HashCode * pid, void *value) | |||
334 | GNUNET_CONTAINER_multihashmap_remove (peers, pid, pos)); | 313 | GNUNET_CONTAINER_multihashmap_remove (peers, pid, pos)); |
335 | if (pos->hello_req != NULL) | 314 | if (pos->hello_req != NULL) |
336 | GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req); | 315 | GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req); |
337 | if (pos->connect_req != NULL) | ||
338 | GNUNET_CORE_peer_request_connect_cancel (pos->connect_req); | ||
339 | if (pos->hello_delay_task != GNUNET_SCHEDULER_NO_TASK) | 316 | if (pos->hello_delay_task != GNUNET_SCHEDULER_NO_TASK) |
340 | GNUNET_SCHEDULER_cancel (pos->hello_delay_task); | 317 | GNUNET_SCHEDULER_cancel (pos->hello_delay_task); |
341 | if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK) | 318 | if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -399,11 +376,9 @@ attempt_connect (struct Peer *pos) | |||
399 | GNUNET_i2s (&pos->pid)); | 376 | GNUNET_i2s (&pos->pid)); |
400 | #endif | 377 | #endif |
401 | GNUNET_STATISTICS_update (stats, | 378 | GNUNET_STATISTICS_update (stats, |
402 | gettext_noop ("# connect requests issued to core"), | 379 | gettext_noop ("# connect requests issued to transport"), |
403 | 1, GNUNET_NO); | 380 | 1, GNUNET_NO); |
404 | pos->connect_req = | 381 | GNUNET_TRANSPORT_try_connect (transport, &pos->pid); |
405 | GNUNET_CORE_peer_request_connect (handle, &pos->pid, | ||
406 | &connect_completed_callback, pos); | ||
407 | } | 382 | } |
408 | 383 | ||
409 | 384 | ||