*/
uint32_t options;
+ /**
+ * Have we gotten the #GNUNET_MESSAGE_TYPE_CORE_INIT message
+ * from this client already?
+ */
+ int got_init;
+
/**
* Number of types of incoming messages this client
* specifically cares about. Size of the @e types array.
struct GSC_Client *c)
{
if ( (0 == c->tcnt) &&
- (0 != (c->options & ~GNUNET_CORE_OPTION_INIT)) )
+ (0 != c->options) )
return GNUNET_YES; /* peer without handlers and inbound/outbond
callbacks matches ALL */
if (NULL == c->types)
types = (const uint16_t *) &im[1];
c->tcnt = msize / sizeof (uint16_t);
c->options = ntohl (im->options);
+ c->got_init = GNUNET_YES;
all_client_options |= c->options;
c->types = GNUNET_malloc (msize);
GNUNET_assert (GNUNET_YES ==
int old_match;
int new_match;
+ if (GNUNET_YES != client->got_init)
+ return;
old_match = GSC_TYPEMAP_test_match (tmap_old,
client->types,
client->tcnt);
new_match = GSC_TYPEMAP_test_match (tmap_new,
client->types,
client->tcnt);
- if ( (old_match == new_match) &&
- (GNUNET_CORE_OPTION_INIT != (client->options & GNUNET_CORE_OPTION_INIT)) )
+ if (old_match == new_match)
{
GNUNET_assert (old_match ==
GNUNET_CONTAINER_multipeermap_contains (client->connectmap,
neighbour));
return; /* no change */
}
- if (old_match == new_match)
- return; /* no change, but the client simply didn't INIT yet */
if (GNUNET_NO == old_match)
{
struct ConnectNotifyMessage *cnm;
GNUNET_break (0);
return;
}
- if (! ( (0 != (all_client_options & options & ~GNUNET_CORE_OPTION_INIT)) ||
+ if (! ( (0 != (all_client_options & options)) ||
(0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) ))
return; /* no client cares about this message notification */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
tm = type_match (ntohs (msg->type),
c);
- if (! ( (0 != (c->options & options & ~GNUNET_CORE_OPTION_INIT)) ||
+ if (! ( (0 != (c->options & options)) ||
( (0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) &&
(GNUNET_YES == tm) ) ) )
continue; /* neither options nor type match permit the message */