change_host_trust (&pos->identity, trust_change);
hs = 0;
im = (struct InfoMessage *) buf;
- im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO);
- im->header.size = htons (sizeof (struct InfoMessage) + hs);
if (pos->hello != NULL)
{
hs = GNUNET_HELLO_size (pos->hello);
sizeof (struct InfoMessage));
memcpy (&im[1], pos->hello, hs);
}
+ im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO);
+ im->header.size = htons (sizeof (struct InfoMessage) + hs);
im->trust = htonl (pos->trust);
im->peer = pos->identity;
GNUNET_SERVER_transmit_context_append_message (tc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Size of `%s' is %u bytes\n",
"HELLO",
- (unsigned int) GNUNET_HELLO_size (hello));
+ (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello));
#endif
ic->callback (ic->callback_cls, &im->peer, hello, ntohl (im->trust));
GNUNET_CLIENT_receive (ic->client,
static const struct GNUNET_CONFIGURATION_Handle *cfg;
+static struct GNUNET_PEERINFO_IteratorContext *ic;
+
static unsigned int retries;
static int
if (peer == NULL)
{
+ ic = NULL;
if ( (3 == *ok) &&
- (retries < 5) )
+ (retries < 50) )
{
/* try again */
retries++;
add_peer ();
- GNUNET_PEERINFO_iterate (cfg,
- sched,
- NULL,
- 0,
- GNUNET_TIME_relative_multiply
- (GNUNET_TIME_UNIT_SECONDS, 15),
- &process, cls);
+ ic = GNUNET_PEERINFO_iterate (cfg,
+ sched,
+ NULL,
+ 0,
+ GNUNET_TIME_relative_multiply
+ (GNUNET_TIME_UNIT_SECONDS, 15),
+ &process, cls);
return;
}
GNUNET_assert (peer == NULL);
*ok = 0;
return;
}
-
if (hello != NULL)
{
GNUNET_assert (3 == *ok);
sched = s;
cfg = c;
add_peer ();
- GNUNET_PEERINFO_iterate (cfg,
- sched,
- NULL,
- 0,
- GNUNET_TIME_relative_multiply
- (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls);
+ ic = GNUNET_PEERINFO_iterate (cfg,
+ sched,
+ NULL,
+ 0,
+ GNUNET_TIME_relative_multiply
+ (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls);
}