GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
}
-#if DEBUG_PEERINFO
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n",
"HELLO", GNUNET_i2s (&pid));
-#endif
bind_address (&pid, hello);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
lpm = (const struct ListPeerMessage *) message;
GNUNET_break (0 == ntohl (lpm->reserved));
-#if DEBUG_PEERINFO
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n",
"GET", GNUNET_i2s (&lpm->peer));
-#endif
tc = GNUNET_SERVER_transmit_context_create (client);
GNUNET_CONTAINER_multihashmap_get_multiple (hostmap, &lpm->peer.hashPubKey,
&add_to_tc, tc);
{
struct GNUNET_SERVER_TransmitContext *tc;
-#if DEBUG_PEERINFO
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL");
-#endif
tc = GNUNET_SERVER_transmit_context_create (client);
GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, tc);
GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0,
handle_notify (void *cls, struct GNUNET_SERVER_Client *client,
const struct GNUNET_MessageHeader *message)
{
-#if DEBUG_PEERINFO
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "NOTIFY");
-#endif
GNUNET_SERVER_notification_context_add (notify_list, client);
GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, client);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
return 0;
if (buf == NULL)
{
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
_("Failed to transmit message to `%s' service.\n"), "PEERINFO");
-#endif
GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
reconnect (h);
if (tqe->cont != NULL)
ret = tqe->size;
GNUNET_assert (size >= ret);
memcpy (buf, &tqe[1], ret);
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO");
-#endif
GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
if (tqe->cont != NULL)
tqe->cont (tqe->cont_cls, GNUNET_OK);
{
uint16_t hs = GNUNET_HELLO_size (hello);
struct TransmissionQueueEntry *tqe;
-
-#if DEBUG_PEERINFO
struct GNUNET_PeerIdentity peer;
GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer));
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n",
GNUNET_i2s (&peer), hs, "HELLO");
-#endif
tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs);
tqe->size = hs;
tqe->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
}
if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END)
{
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received end of list of peers from `%s' service\n", "PEERINFO");
-#endif
trigger_transmit (ic->h);
if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (ic->timeout_task);
return;
}
}
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received %u bytes of `%s' information about peer `%s' from `%s' service\n",
(hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO",
GNUNET_i2s (&im->peer), "PEERINFO");
-#endif
ic->h->in_receive = GNUNET_YES;
if (ic->callback != NULL)
ic->callback (ic->callback_cls, &im->peer, hello, NULL);
GNUNET_free (ic);
return;
}
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n",
"PEERINFO");
-#endif
ic->h->in_receive = GNUNET_YES;
ic->in_receive = GNUNET_YES;
ic->tqe = NULL;
if (peer == NULL)
{
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Requesting list of peers from PEERINFO service\n");
-#endif
tqe =
GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
sizeof (struct GNUNET_MessageHeader));
}
else
{
-#if DEBUG_PEERINFO
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Requesting information on peer `%4s' from PEERINFO service\n",
GNUNET_i2s (peer));
-#endif
tqe =
GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
sizeof (struct ListPeerMessage));