/**
* Function to call after transmission has succeeded.
- *
+ *
* @param cls closure
* @param success GNUNET_OK if transmission worked, GNUNET_SYSERR on error
*/
*
* @param h handle to the service
*/
-static void trigger_transmit (struct GNUNET_PEERINFO_Handle *h);
+static void
+trigger_transmit (struct GNUNET_PEERINFO_Handle *h);
/**
*
* @param h handle to the service
*/
-static void reconnect (struct GNUNET_PEERINFO_Handle *h);
+static void
+reconnect (struct GNUNET_PEERINFO_Handle *h);
/**
* Task scheduled to re-try connecting to the peerinfo service.
*
* @param cls the 'struct GNUNET_PEERINFO_Handle'
- * @param ts scheduler context
+ * @param tc scheduler context
*/
static void
reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
h->client = GNUNET_CLIENT_connect ("peerinfo", h->cfg);
if (NULL == h->client)
{
- h->r_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
- &reconnect_task, h);
+ h->r_task =
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect_task,
+ h);
return;
}
trigger_transmit (h);
memcpy (buf, &tqe[1], ret);
#if DEBUG_PEERINFO
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Transmitting request of size %u to `%s' service.\n",
- ret, "PEERINFO");
+ "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)
reconnect (h);
return;
}
- h->th = GNUNET_CLIENT_notify_transmit_ready (h->client,
- tqe->size,
- GNUNET_TIME_absolute_get_remaining
- (tqe->timeout), GNUNET_YES,
- &do_transmit, h);
+ h->th =
+ GNUNET_CLIENT_notify_transmit_ready (h->client, tqe->size,
+ GNUNET_TIME_absolute_get_remaining
+ (tqe->timeout), GNUNET_YES,
+ &do_transmit, h);
}
/**
- * Add a host to the persistent list. This method operates in
+ * Add a host to the persistent list. This method operates in
* semi-reliable mode: if the transmission is not completed by
* the time 'GNUNET_PEERINFO_disconnect' is called, it will be
* aborted. Furthermore, if a second HELLO is added for the
ic->h->in_receive = GNUNET_YES;
if (ic->callback != NULL)
ic->callback (ic->callback_cls, &im->peer, hello, NULL);
- GNUNET_CLIENT_receive (ic->h->client,
- &peerinfo_handler,
- ic, GNUNET_TIME_absolute_get_remaining (ic->timeout));
+ GNUNET_CLIENT_receive (ic->h->client, &peerinfo_handler, ic,
+ GNUNET_TIME_absolute_get_remaining (ic->timeout));
}
ic->h->in_receive = GNUNET_YES;
ic->in_receive = GNUNET_YES;
ic->tqe = NULL;
- GNUNET_CLIENT_receive (ic->h->client,
- &peerinfo_handler,
- ic, GNUNET_TIME_absolute_get_remaining (ic->timeout));
+ GNUNET_CLIENT_receive (ic->h->client, &peerinfo_handler, ic,
+ GNUNET_TIME_absolute_get_remaining (ic->timeout));
}
/**
- * Peerinfo iteration request has timed out.
+ * Peerinfo iteration request has timed out.
*
* @param cls the 'struct GNUNET_PEERINFO_IteratorContext*'
* @param tc scheduler context
GNUNET_CONTAINER_DLL_remove (ic->h->tq_head, ic->h->tq_tail, ic->tqe);
else
reconnect (ic->h);
- ic->callback (ic->callback_cls,
- NULL, NULL,
+ ic->callback (ic->callback_cls, NULL, NULL,
_
("Timeout transmitting iteration request to `PEERINFO' service.\n"));
ic->callback = NULL;
*
* Instead of calling this function with 'peer == NULL' it is often
* better to use 'GNUNET_PEERINFO_notify'.
- *
+ *
* @param h handle to the peerinfo service
* @param peer restrict iteration to this peer only (can be NULL)
* @param timeout how long to wait until timing out
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Requesting list of peers from PEERINFO service\n");
#endif
- tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
- sizeof (struct GNUNET_MessageHeader));
+ tqe =
+ GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
+ sizeof (struct GNUNET_MessageHeader));
tqe->size = sizeof (struct GNUNET_MessageHeader);
lapm = (struct GNUNET_MessageHeader *) &tqe[1];
lapm->size = htons (sizeof (struct GNUNET_MessageHeader));
"Requesting information on peer `%4s' from PEERINFO service\n",
GNUNET_i2s (peer));
#endif
- tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
- sizeof (struct ListPeerMessage));
+ tqe =
+ GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
+ sizeof (struct ListPeerMessage));
tqe->size = sizeof (struct ListPeerMessage);
lpm = (struct ListPeerMessage *) &tqe[1];
lpm->header.size = htons (sizeof (struct ListPeerMessage));
ic->callback = callback;
ic->callback_cls = callback_cls;
ic->timeout = GNUNET_TIME_relative_to_absolute (timeout);
- ic->timeout_task = GNUNET_SCHEDULER_add_delayed (timeout,
- &signal_timeout, ic);
+ ic->timeout_task =
+ GNUNET_SCHEDULER_add_delayed (timeout, &signal_timeout, ic);
tqe->timeout = ic->timeout;
tqe->cont = &iterator_start_receive;
tqe->cont_cls = ic;