set flag to know that client did call init, thereby avoiding assertion failure on...
authorChristian Grothoff <christian@grothoff.org>
Mon, 26 Sep 2016 23:29:54 +0000 (23:29 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 26 Sep 2016 23:29:54 +0000 (23:29 +0000)
src/core/core.h
src/core/core_api.c
src/core/gnunet-service-core.c

index 7c3a5bdd8e0648bd2dd8a09593a8028c7d9a18d8..7a6ffa62b0a5d6453815126437d4f452308abace 100644 (file)
  */
 #define GNUNET_CORE_OPTION_NOTHING             0
 
+/**
+ * The client did properly initialize the connection.
+ */
+#define GNUNET_CORE_OPTION_INIT                1
+
 /**
  * Client cares about connectivity changes.
  */
index 67f17352ddfd9170f8117b04332fabd6b0d4c28a..1c97a19d2dd4a4bab1ba2fa7ef788bdb1e448596 100644 (file)
@@ -815,7 +815,7 @@ reconnect (struct GNUNET_CORE_Handle *h)
   env = GNUNET_MQ_msg_extra (init,
                              sizeof (uint16_t) * h->hcnt,
                              GNUNET_MESSAGE_TYPE_CORE_INIT);
-  opt = 0;
+  opt = GNUNET_CORE_OPTION_INIT;
   if (NULL != h->inbound_notify)
   {
     if (h->inbound_hdr_only)
index 2cf43f111dc17e1aac3e0c8587f30f9ac6b7e308..fe7126d03ef3e145ebd7546a5b63f90ea5f97a13 100644 (file)
@@ -681,6 +681,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
   int old_match;
   int new_match;
 
+  if (GNUNET_CORE_OPTION_NOTHING == client->options)
+    return; /* client did not yet send init */
   old_match = GSC_TYPEMAP_test_match (tmap_old,
                                      client->types,
                                      client->tcnt);