{
struct GNUNET_GNS_Handle *handle = qe->gns_handle;
struct PendingMessage *p = (struct PendingMessage *) &qe[1];
+ GNUNET_GNS_LookupResultProcessor proc;
+ void *proc_cls;
uint32_t rd_count = ntohl (msg->rd_count);
- struct GNUNET_NAMESTORE_RecordData rd[rd_count];
+ struct GNUNET_GNSRECORD_Data rd[rd_count];
size_t mlen;
if (GNUNET_YES != p->transmitted)
}
mlen = ntohs (msg->header.size);
mlen -= sizeof (struct GNUNET_GNS_ClientLookupResultMessage);
- if (GNUNET_SYSERR == GNUNET_NAMESTORE_records_deserialize (mlen,
+ proc = qe->lookup_proc;
+ proc_cls = qe->proc_cls;
+ GNUNET_CONTAINER_DLL_remove (handle->lookup_head, handle->lookup_tail, qe);
+ GNUNET_free (qe);
+ if (GNUNET_SYSERR == GNUNET_GNSRECORD_records_deserialize (mlen,
(const char*) &msg[1],
rd_count,
rd))
{
LOG (GNUNET_ERROR_TYPE_ERROR,
- _("Failed to serialize lookup reply from GNS service!\n"));
- qe->lookup_proc (qe->proc_cls, 0, NULL);
+ _("Failed to deserialize lookup reply from GNS service!\n"));
+ proc (proc_cls, 0, NULL);
}
else
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received lookup reply from GNS service (%u records)\n",
(unsigned int) rd_count);
- qe->lookup_proc (qe->proc_cls, rd_count, rd);
+ proc (proc_cls, rd_count, rd);
}
- GNUNET_CONTAINER_DLL_remove (handle->lookup_head, handle->lookup_tail, qe);
- GNUNET_free (qe);
}
force_reconnect (handle);
return;
}
+
+ GNUNET_CLIENT_receive (handle->client, &process_message, handle,
+ GNUNET_TIME_UNIT_FOREVER_REL);
switch (ntohs (msg->type))
{
case GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT:
force_reconnect (handle);
return;
}
- GNUNET_CLIENT_receive (handle->client, &process_message, handle,
- GNUNET_TIME_UNIT_FOREVER_REL);
}
* @param only_cached #GNUNET_YES to only check locally (not in the DHT)
* @param shorten_zone_key the private key of the shorten zone (can be NULL)
* @param proc processor to call on result
- * @param proc_cls closure for processor
+ * @param proc_cls closure for @a proc
* @return handle to the get request
*/
struct GNUNET_GNS_LookupRequest*
GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
const char *name,
const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
- int type,
+ uint32_t type,
int only_cached,
const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key,
GNUNET_GNS_LookupResultProcessor proc,
lookup_msg->header.type = htons (GNUNET_MESSAGE_TYPE_GNS_LOOKUP);
lookup_msg->header.size = htons (msize);
lookup_msg->id = htonl (lr->r_id);
- lookup_msg->only_cached = htonl (only_cached);
+ lookup_msg->only_cached = htons (only_cached);
lookup_msg->zone = *zone;
lookup_msg->type = htonl (type);
if (NULL != shorten_zone_key)