From: Christian Grothoff Date: Fri, 21 Oct 2011 22:39:26 +0000 (+0000) Subject: try to make sure to send connect on new neighbour even if tcnts are both empty X-Git-Tag: initial-import-from-subversion-38251~16343 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=16b954786d5a14360c7f974f3554e041e3f32ed1;p=oweals%2Fgnunet.git try to make sure to send connect on new neighbour even if tcnts are both empty --- diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index c37f5bafc..ec286a888 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c @@ -612,6 +612,7 @@ GSC_CLIENTS_reject_request (struct GSC_ClientActiveRequest *car) * @param atsi_count number of entries in 'ats' array * @param tmap_old previous type map for the neighbour, NULL for disconnect * @param tmap_new updated type map for the neighbour, NULL for disconnect + * @param is_new GNUNET_YES if this is a completely new neighbour */ void GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, @@ -619,7 +620,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count, const struct GSC_TypeMap *tmap_old, - const struct GSC_TypeMap *tmap_new) + const struct GSC_TypeMap *tmap_new, + int is_new) { struct ConnectNotifyMessage *cnm; size_t size; @@ -639,6 +641,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, if (tmap_old != NULL) old_match = GNUNET_YES; } + if (GNUNET_YES == is_new) + old_match = GNUNET_NO; if (old_match == new_match) return; /* no change */ if (old_match == GNUNET_NO) @@ -706,7 +710,8 @@ GSC_CLIENTS_notify_clients_about_neighbour (const struct GNUNET_PeerIdentity *ne for (c = client_head; c != NULL; c = c->next) GSC_CLIENTS_notify_client_about_neighbour (c, neighbour, atsi, atsi_count, - tmap_old, tmap_new); + tmap_old, tmap_new, + GNUNET_NO); } diff --git a/src/core/gnunet-service-core_clients.h b/src/core/gnunet-service-core_clients.h index 2385efc05..21dec769a 100644 --- a/src/core/gnunet-service-core_clients.h +++ b/src/core/gnunet-service-core_clients.h @@ -56,6 +56,7 @@ GSC_CLIENTS_send_to_client (struct GNUNET_SERVER_Client *client, * @param atsi_count number of entries in 'ats' array * @param tmap_old previous type map for the neighbour, NULL for disconnect * @param tmap_new updated type map for the neighbour, NULL for disconnect + * @param is_new GNUNET_YES if this is a completely new neighbour */ void GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, @@ -63,7 +64,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count, const struct GSC_TypeMap *tmap_old, - const struct GSC_TypeMap *tmap_new); + const struct GSC_TypeMap *tmap_new, + int is_new); /** diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index c239f27c1..587c2e12f 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c @@ -256,7 +256,8 @@ notify_client_about_session (void *cls, &session->peer, NULL, 0, /* FIXME: ATS!? */ NULL, /* old TMAP: none */ - session->tmap); + session->tmap, + GNUNET_YES); return GNUNET_OK; }