[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r38039 - gnunet/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r38039 - gnunet/src/core |
Date: |
Thu, 29 Sep 2016 00:09:29 +0200 |
Author: grothoff
Date: 2016-09-29 00:09:27 +0200 (Thu, 29 Sep 2016)
New Revision: 38039
Modified:
gnunet/src/core/core.h
gnunet/src/core/core_api.c
gnunet/src/core/gnunet-service-core.c
Log:
-cleaning up implementation of typemap signalling
Modified: gnunet/src/core/core.h
===================================================================
--- gnunet/src/core/core.h 2016-09-28 12:43:27 UTC (rev 38038)
+++ gnunet/src/core/core.h 2016-09-28 22:09:27 UTC (rev 38039)
@@ -45,11 +45,6 @@
#define GNUNET_CORE_OPTION_NOTHING 0
/**
- * The client did properly initialize the connection.
- */
-#define GNUNET_CORE_OPTION_INIT 1
-
-/**
* Client cares about connectivity changes.
*/
#define GNUNET_CORE_OPTION_SEND_STATUS_CHANGE 4
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2016-09-28 12:43:27 UTC (rev 38038)
+++ gnunet/src/core/core_api.c 2016-09-28 22:09:27 UTC (rev 38039)
@@ -815,7 +815,7 @@
env = GNUNET_MQ_msg_extra (init,
sizeof (uint16_t) * h->hcnt,
GNUNET_MESSAGE_TYPE_CORE_INIT);
- opt = GNUNET_CORE_OPTION_INIT;
+ opt = GNUNET_CORE_OPTION_NOTHING;
if (NULL != h->inbound_notify)
{
if (h->inbound_hdr_only)
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2016-09-28 12:43:27 UTC (rev
38038)
+++ gnunet/src/core/gnunet-service-core.c 2016-09-28 22:09:27 UTC (rev
38039)
@@ -89,6 +89,12 @@
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.
*/
@@ -140,7 +146,7 @@
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)
@@ -188,6 +194,7 @@
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 ==
@@ -681,6 +688,8 @@
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);
@@ -687,8 +696,7 @@
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,
@@ -695,8 +703,6 @@
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;
@@ -789,7 +795,7 @@
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,
@@ -808,7 +814,7 @@
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 */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r38039 - gnunet/src/core,
gnunet <=