try to make sure to send connect on new neighbour even if tcnts are both empty
authorChristian Grothoff <christian@grothoff.org>
Fri, 21 Oct 2011 22:39:26 +0000 (22:39 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 21 Oct 2011 22:39:26 +0000 (22:39 +0000)
src/core/gnunet-service-core_clients.c
src/core/gnunet-service-core_clients.h
src/core/gnunet-service-core_sessions.c

index c37f5bafc782ed79cd4532f8a46590832ce7264f..ec286a8883b0e19c5bf3fa400dbb0432ee30cce5 100644 (file)
@@ -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);
 }
 
 
index 2385efc0578683d62377ab0d0059700e1f30bd08..21dec769a709d612fac63e83722287bf9d9dfe10 100644 (file)
@@ -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);
 
 
 /**
index c239f27c1b8af20e0393b2fb610dd136dcf14791..587c2e12f2d309b59dc759c594bbf6d7146419df 100644 (file)
@@ -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;
 }