From 94a7d55c9473299c471bce218e68b90847d961b8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 Nov 2015 11:40:26 +0000 Subject: -more DCE after try_connect refactoring --- .../gnunet-service-transport_neighbours.c | 77 ---------------------- src/transport/transport.h | 25 ------- 2 files changed, 102 deletions(-) diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 4d3e8c0bc..6b4300488 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -461,52 +461,11 @@ struct NeighbourMapEntry }; -/** - * Context for blacklist checks and the #try_connect_bl_check_cont() - * function. Stores information about ongoing blacklist checks. - */ -struct BlackListCheckContext -{ - - /** - * We keep blacklist checks in a DLL. - */ - struct BlackListCheckContext *next; - - /** - * We keep blacklist checks in a DLL. - */ - struct BlackListCheckContext *prev; - - /** - * Address that is being checked. - */ - struct NeighbourAddress na; - - /** - * Handle to the ongoing blacklist check. - */ - struct GST_BlacklistCheck *bc; -}; - - /** * Hash map from peer identities to the respective `struct NeighbourMapEntry`. */ static struct GNUNET_CONTAINER_MultiPeerMap *neighbours; -/** - * We keep blacklist checks in a DLL so that we can find - * the 'sessions' in their 'struct NeighbourAddress' if - * a session goes down. - */ -static struct BlackListCheckContext *bc_head; - -/** - * We keep blacklist checks in a DLL. - */ -static struct BlackListCheckContext *bc_tail; - /** * List of pending blacklist checks: head */ @@ -3256,25 +3215,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, struct GNUNET_ATS_Session *session) { struct NeighbourMapEntry *n; - struct BlackListCheckContext *bcc; - struct BlackListCheckContext *bcc_next; - /* make sure to cancel all ongoing blacklist checks involving 'session' */ - bcc_next = bc_head; - while (NULL != (bcc = bcc_next)) - { - bcc_next = bcc->next; - if (bcc->na.session == session) - { - if (NULL != bcc->bc) - GST_blacklist_test_cancel (bcc->bc); - GNUNET_HELLO_address_free (bcc->na.address); - GNUNET_CONTAINER_DLL_remove (bc_head, - bc_tail, - bcc); - GNUNET_free (bcc); - } - } if (NULL == (n = lookup_neighbour (peer))) return GNUNET_NO; /* can't affect us */ if (session != n->primary_address.session) @@ -3817,9 +3758,6 @@ disconnect_all_neighbours (void *cls, void GST_neighbours_stop () { - struct BlacklistCheckSwitchContext *cur; - struct BlacklistCheckSwitchContext *next; - if (NULL == neighbours) return; if (NULL != util_transmission_tk) @@ -3832,21 +3770,6 @@ GST_neighbours_stop () NULL); GNUNET_CONTAINER_multipeermap_destroy (neighbours); neighbours = NULL; - next = pending_bc_head; - for (cur = next; NULL != cur; cur = next) - { - next = cur->next; - GNUNET_CONTAINER_DLL_remove (pending_bc_head, - pending_bc_tail, - cur); - - if (NULL != cur->blc) - { - GST_blacklist_test_cancel (cur->blc); - cur->blc = NULL; - } - GNUNET_free (cur); - } } diff --git a/src/transport/transport.h b/src/transport/transport.h index 7f2b0f935..9101edaf8 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -164,31 +164,6 @@ struct DisconnectInfoMessage }; -/** - * Message type for sending a request connect message - * to the transport service. Must be done before transport - * api will allow messages to be queued/sent to transport - * service for transmission to a peer. - */ -struct TransportRequestConnectMessage -{ - /** - * Message header with type #GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT - */ - struct GNUNET_MessageHeader header; - - /** - * Reserved (0). - */ - uint32_t reserved GNUNET_PACKED; - - /** - * Identity of the peer we would like to connect to. - */ - struct GNUNET_PeerIdentity peer; -}; - - /** * Message used to set a particular bandwidth quota. Sent TO the * service to set an incoming quota, sent FROM the service to update -- cgit v1.2.3