REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / transport / gnunet-service-transport.c
index c621ea686b8d6ff4348b5c6834efd53164117d14..e1dfbae0f3c57a42337fde02c22cc1bef3b6a2e9 100644 (file)
@@ -113,7 +113,12 @@ enum ClientType
   /**
    * It is a blacklist, query about allowed connections.
    */
-  CT_BLACKLIST = 3
+  CT_BLACKLIST = 3,
+
+  /**
+   * CORE client without any handlers.
+   */
+  CT_CORE_NO_HANDLERS = 4
 };
 
 
@@ -444,8 +449,8 @@ unicast (struct TransportClient *tc,
                 GNUNET_MQ_get_length (tc->mq),
                 MAX_PENDING);
     GNUNET_STATISTICS_update (GST_stats,
-                              gettext_noop
-                              ("# messages dropped due to slow client"), 1,
+                              gettext_noop ("# messages dropped due to slow client"),
+                              1,
                               GNUNET_NO);
     return;
   }
@@ -570,6 +575,8 @@ client_disconnect_cb (void *cls,
                                             bc);
     }
     break;
+  case CT_CORE_NO_HANDLERS:
+    break;
   }
   GNUNET_free (tc);
 }
@@ -650,6 +657,8 @@ handle_client_start (void *cls,
   }
   if (0 != (2 & options))
     tc->type = CT_CORE;
+  else
+    tc->type = CT_CORE_NO_HANDLERS;
   hello = GST_hello_get ();
   if (NULL != hello)
     unicast (tc,
@@ -1352,6 +1361,8 @@ GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
        NULL != tc;
        tc = tc->next)
   {
+    if (CT_NONE == tc->type)
+      continue; /* client not yet ready */
     if ( (GNUNET_YES == may_drop) &&
          (CT_CORE != tc->type) )
       continue; /* skip, this client does not care about payload */
@@ -1383,7 +1394,7 @@ GST_clients_broadcast_peer_notification (const struct GNUNET_PeerIdentity *peer,
 {
   struct GNUNET_MQ_Envelope *env;
   struct PeerIterateResponseMessage *msg;
-  
+
   msg = compose_address_iterate_response_message (peer,
                                                  address);
   msg->state = htonl (state);