[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37309 - gnunet/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37309 - gnunet/src/core |
Date: |
Mon, 20 Jun 2016 22:12:52 +0200 |
Author: grothoff
Date: 2016-06-20 22:12:52 +0200 (Mon, 20 Jun 2016)
New Revision: 37309
Modified:
gnunet/src/core/core_api.c
Log:
-tolerate init CB being NULL from the beginning
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2016-06-20 19:56:20 UTC (rev 37308)
+++ gnunet/src/core/core_api.c 2016-06-20 20:12:52 UTC (rev 37309)
@@ -215,6 +215,11 @@
*/
int currently_down;
+ /**
+ * Did we ever get INIT?
+ */
+ int have_init;
+
};
@@ -359,6 +364,7 @@
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Connected to core service of peer `%s'.\n",
GNUNET_i2s (&h->me));
+ h->have_init = GNUNET_YES;
init (h->cls,
&h->me);
}
@@ -366,9 +372,17 @@
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Successfully reconnected to core service.\n");
- GNUNET_break (0 == memcmp (&h->me,
- &m->my_identity,
- sizeof (struct GNUNET_PeerIdentity)));
+ if (GNUNET_NO == h->have_init)
+ {
+ h->me = m->my_identity;
+ h->have_init = GNUNET_YES;
+ }
+ else
+ {
+ GNUNET_break (0 == memcmp (&h->me,
+ &m->my_identity,
+ sizeof (struct GNUNET_PeerIdentity)));
+ }
}
/* fake 'connect to self' */
pr = GNUNET_new (struct PeerRecord);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37309 - gnunet/src/core,
gnunet <=