diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-21 22:39:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-21 22:39:26 +0000 |
commit | 16b954786d5a14360c7f974f3554e041e3f32ed1 (patch) | |
tree | 4268583f8333ca54ce7f530d72c56b1e4745c304 /src/core | |
parent | ddc17ac9517141ce9b342ddbb10c87ed328da01b (diff) | |
download | gnunet-16b954786d5a14360c7f974f3554e041e3f32ed1.tar.gz gnunet-16b954786d5a14360c7f974f3554e041e3f32ed1.zip |
try to make sure to send connect on new neighbour even if tcnts are both empty
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gnunet-service-core_clients.c | 9 | ||||
-rw-r--r-- | src/core/gnunet-service-core_clients.h | 4 | ||||
-rw-r--r-- | src/core/gnunet-service-core_sessions.c | 3 |
3 files changed, 12 insertions, 4 deletions
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) | |||
612 | * @param atsi_count number of entries in 'ats' array | 612 | * @param atsi_count number of entries in 'ats' array |
613 | * @param tmap_old previous type map for the neighbour, NULL for disconnect | 613 | * @param tmap_old previous type map for the neighbour, NULL for disconnect |
614 | * @param tmap_new updated type map for the neighbour, NULL for disconnect | 614 | * @param tmap_new updated type map for the neighbour, NULL for disconnect |
615 | * @param is_new GNUNET_YES if this is a completely new neighbour | ||
615 | */ | 616 | */ |
616 | void | 617 | void |
617 | GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, | 618 | GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, |
@@ -619,7 +620,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, | |||
619 | const struct GNUNET_ATS_Information *atsi, | 620 | const struct GNUNET_ATS_Information *atsi, |
620 | unsigned int atsi_count, | 621 | unsigned int atsi_count, |
621 | const struct GSC_TypeMap *tmap_old, | 622 | const struct GSC_TypeMap *tmap_old, |
622 | const struct GSC_TypeMap *tmap_new) | 623 | const struct GSC_TypeMap *tmap_new, |
624 | int is_new) | ||
623 | { | 625 | { |
624 | struct ConnectNotifyMessage *cnm; | 626 | struct ConnectNotifyMessage *cnm; |
625 | size_t size; | 627 | size_t size; |
@@ -639,6 +641,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, | |||
639 | if (tmap_old != NULL) | 641 | if (tmap_old != NULL) |
640 | old_match = GNUNET_YES; | 642 | old_match = GNUNET_YES; |
641 | } | 643 | } |
644 | if (GNUNET_YES == is_new) | ||
645 | old_match = GNUNET_NO; | ||
642 | if (old_match == new_match) | 646 | if (old_match == new_match) |
643 | return; /* no change */ | 647 | return; /* no change */ |
644 | if (old_match == GNUNET_NO) | 648 | if (old_match == GNUNET_NO) |
@@ -706,7 +710,8 @@ GSC_CLIENTS_notify_clients_about_neighbour (const struct GNUNET_PeerIdentity *ne | |||
706 | for (c = client_head; c != NULL; c = c->next) | 710 | for (c = client_head; c != NULL; c = c->next) |
707 | GSC_CLIENTS_notify_client_about_neighbour (c, neighbour, atsi, | 711 | GSC_CLIENTS_notify_client_about_neighbour (c, neighbour, atsi, |
708 | atsi_count, | 712 | atsi_count, |
709 | tmap_old, tmap_new); | 713 | tmap_old, tmap_new, |
714 | GNUNET_NO); | ||
710 | } | 715 | } |
711 | 716 | ||
712 | 717 | ||
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, | |||
56 | * @param atsi_count number of entries in 'ats' array | 56 | * @param atsi_count number of entries in 'ats' array |
57 | * @param tmap_old previous type map for the neighbour, NULL for disconnect | 57 | * @param tmap_old previous type map for the neighbour, NULL for disconnect |
58 | * @param tmap_new updated type map for the neighbour, NULL for disconnect | 58 | * @param tmap_new updated type map for the neighbour, NULL for disconnect |
59 | * @param is_new GNUNET_YES if this is a completely new neighbour | ||
59 | */ | 60 | */ |
60 | void | 61 | void |
61 | GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, | 62 | GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, |
@@ -63,7 +64,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, | |||
63 | const struct GNUNET_ATS_Information *atsi, | 64 | const struct GNUNET_ATS_Information *atsi, |
64 | unsigned int atsi_count, | 65 | unsigned int atsi_count, |
65 | const struct GSC_TypeMap *tmap_old, | 66 | const struct GSC_TypeMap *tmap_old, |
66 | const struct GSC_TypeMap *tmap_new); | 67 | const struct GSC_TypeMap *tmap_new, |
68 | int is_new); | ||
67 | 69 | ||
68 | 70 | ||
69 | /** | 71 | /** |
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, | |||
256 | &session->peer, | 256 | &session->peer, |
257 | NULL, 0, /* FIXME: ATS!? */ | 257 | NULL, 0, /* FIXME: ATS!? */ |
258 | NULL, /* old TMAP: none */ | 258 | NULL, /* old TMAP: none */ |
259 | session->tmap); | 259 | session->tmap, |
260 | GNUNET_YES); | ||
260 | return GNUNET_OK; | 261 | return GNUNET_OK; |
261 | } | 262 | } |
262 | 263 | ||