* DLL
*/
struct GNUNET_GNS_LookupRequest *next;
-
+
/**
* DLL
*/
struct GNUNET_GNS_LookupRequest *prev;
-
+
/**
- * handle to gns
+ * handle to gns
*/
struct GNUNET_GNS_Handle *gns_handle;
-
+
/**
- * processor to call on lookup result
+ * processor to call on lookup result
*/
GNUNET_GNS_LookupResultProcessor lookup_proc;
/**
- * processor closure
+ * processor closure
*/
void *proc_cls;
-
+
/**
- * request id
+ * request id
*/
uint32_t r_id;
-
+
};
* Currently pending transmission request (or NULL).
*/
struct GNUNET_CLIENT_TransmitHandle *th;
-
+
/**
* Head of linked list of shorten messages we would like to transmit.
*/
* Tail of linked list of shorten messages we would like to transmit.
*/
struct PendingMessage *pending_tail;
-
+
/**
* Head of linked list of lookup messages we would like to transmit.
*/
* Reconnect task
*/
GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
-
+
/**
* How long do we wait until we try to reconnect?
*/
* Request Id generator. Incremented by one for each request.
*/
uint32_t r_id_gen;
-
+
/**
* Did we start our receive loop yet?
*/
p->transmitted = GNUNET_NO;
GNUNET_CONTAINER_DLL_insert (handle->pending_head,
handle->pending_tail,
- p);
+ p);
}
handle->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (handle->reconnect_backoff);
handle->reconnect_task = GNUNET_SCHEDULER_add_delayed (handle->reconnect_backoff,
struct PendingMessage *p = handle->pending_head;
if (NULL == handle->client)
- return; /* wait for reconnect */
+ return; /* wait for reconnect */
if (NULL != handle->th)
- return; /* transmission request already pending */
+ return; /* transmission request already pending */
while ((NULL != p) && (p->transmitted == GNUNET_YES))
p = p->next;
if (NULL == p)
return; /* no messages pending */
-
+
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Trying to transmit %u bytes\n",
+ "Trying to transmit %u bytes\n",
(unsigned int) p->size);
handle->th =
GNUNET_CLIENT_notify_transmit_ready (handle->client,
"Transmission to GNS service failed!\n");
force_reconnect (handle);
return 0;
- }
+ }
if (NULL == (p = handle->pending_head))
return 0;
qe->lookup_proc (qe->proc_cls, 0, NULL);
}
else
- {
+ {
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received lookup reply from GNS service (%u records)\n",
(unsigned int) rd_count);
struct GNUNET_GNS_LookupRequest *lr;
const struct GNUNET_GNS_ClientLookupResultMessage *lookup_msg;
uint32_t r_id;
-
+
if (NULL == msg)
{
force_reconnect (handle);
return;
}
lookup_msg = (const struct GNUNET_GNS_ClientLookupResultMessage *) msg;
- r_id = ntohl (lookup_msg->id);
- for (lr = handle->lookup_head; NULL != lr; lr = lr->next)
+ r_id = ntohl (lookup_msg->id);
+ for (lr = handle->lookup_head; NULL != lr; lr = lr->next)
if (lr->r_id == r_id)
{
- process_lookup_reply(lr, lookup_msg);
+ process_lookup_reply(lr, lookup_msg);
break;
}
break;
{
struct PendingMessage *p = (struct PendingMessage*) &lr[1];
- GNUNET_assert (NULL != lr->gns_handle);
+ GNUNET_assert (NULL != lr->gns_handle);
if (GNUNET_NO == p->transmitted)
GNUNET_CONTAINER_DLL_remove (lr->gns_handle->pending_head,
lr->gns_handle->pending_tail,
{
GNUNET_break (0);
return NULL;
- }
+ }
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Trying to lookup `%s' in GNS\n",
+ "Trying to lookup `%s' in GNS\n",
name);
msize = sizeof (struct GNUNET_GNS_ClientLookupMessage)
+ strlen (name) + 1;