[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r38030 - gnunet/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r38030 - gnunet/src/core |
Date: |
Tue, 27 Sep 2016 01:49:36 +0200 |
Author: grothoff
Date: 2016-09-27 01:49:36 +0200 (Tue, 27 Sep 2016)
New Revision: 38030
Modified:
gnunet/src/core/gnunet-service-core.c
Log:
fix client init handling
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2016-09-26 23:29:54 UTC (rev
38029)
+++ gnunet/src/core/gnunet-service-core.c 2016-09-26 23:49:36 UTC (rev
38030)
@@ -140,7 +140,7 @@
struct GSC_Client *c)
{
if ( (0 == c->tcnt) &&
- (0 != c->options) )
+ (0 != (c->options & ~GNUNET_CORE_OPTION_INIT)) )
return GNUNET_YES; /* peer without handlers and inbound/outbond
callbacks matches ALL */
if (NULL == c->types)
@@ -681,8 +681,6 @@
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);
@@ -689,7 +687,8 @@
new_match = GSC_TYPEMAP_test_match (tmap_new,
client->types,
client->tcnt);
- if (old_match == new_match)
+ if ( (old_match == new_match) &&
+ (GNUNET_CORE_OPTION_INIT != (client->options &
GNUNET_CORE_OPTION_INIT)) )
{
GNUNET_assert (old_match ==
GNUNET_CONTAINER_multipeermap_contains (client->connectmap,
@@ -696,6 +695,8 @@
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;
@@ -722,7 +723,7 @@
{
struct DisconnectNotifyMessage *dcm;
- /* send disconnect */
+ /* send disconnect */
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multipeermap_contains (client->connectmap,
neighbour));
@@ -788,7 +789,7 @@
GNUNET_break (0);
return;
}
- if (! ( (0 != (all_client_options & options)) ||
+ if (! ( (0 != (all_client_options & options & ~GNUNET_CORE_OPTION_INIT)) ||
(0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) ))
return; /* no client cares about this message notification */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -807,7 +808,7 @@
tm = type_match (ntohs (msg->type),
c);
- if (! ( (0 != (c->options & options)) ||
+ if (! ( (0 != (c->options & options & ~GNUNET_CORE_OPTION_INIT)) ||
( (0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) &&
(GNUNET_YES == tm) ) ) )
continue; /* neither options nor type match permit the message */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r38030 - gnunet/src/core,
gnunet <=