-
- msize = sizeof (struct GNUNET_GNS_ClientShortenMessage) + strlen(name) + 1;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to shorten %s in GNS\n", name);
-
- qe = GNUNET_malloc(sizeof (struct GNUNET_GNS_QueueEntry));
- qe->gns_handle = handle;
- qe->shorten_proc = proc;
- qe->proc_cls = proc_cls;
- qe->r_id = get_request_id(handle);
- GNUNET_CONTAINER_DLL_insert_tail(handle->shorten_head,
- handle->shorten_tail, qe);
-
- pending = GNUNET_malloc (sizeof (struct PendingMessage) + msize);
- memset(pending, 0, (sizeof (struct PendingMessage) + msize));
-
- pending->size = msize;
-
- shorten_msg = (struct GNUNET_GNS_ClientShortenMessage *) &pending[1];
- shorten_msg->header.type = htons (GNUNET_MESSAGE_TYPE_GNS_SHORTEN);
- shorten_msg->header.size = htons (msize);
- shorten_msg->id = htonl(qe->r_id);
-
- if (NULL != zone)
- {
- shorten_msg->use_default_zone = htonl(0);
- memcpy(&shorten_msg->zone, zone,
- sizeof(struct GNUNET_CRYPTO_ShortHashCode));
- }
- else
- {
- shorten_msg->use_default_zone = htonl(1);
- memset(&shorten_msg->zone, 0, sizeof(struct GNUNET_CRYPTO_ShortHashCode));
- }
-
- memcpy(&shorten_msg[1], name, strlen(name));
-
- GNUNET_CONTAINER_DLL_insert_tail (handle->pending_head, handle->pending_tail,
- pending);
-
- process_pending_messages (handle);
- return qe;
-}
-
-/**
- * Perform a name shortening operation on the GNS.
- *
- * @param handle handle to the GNS service
- * @param name the name to look up
- * @param proc function to call on result
- * @param proc_cls closure for processor
- * @return handle to the operation
- */
-struct GNUNET_GNS_QueueEntry *
-GNUNET_GNS_shorten (struct GNUNET_GNS_Handle *handle,
- const char * name,
- GNUNET_GNS_ShortenResultProcessor proc,
- void *proc_cls)
-{
- return GNUNET_GNS_shorten_zone (handle, name, NULL, proc, proc_cls);
-}
-/**
- * Perform an authority lookup for a given name.
- *
- * @param handle handle to the GNS service
- * @param name the name to look up authority for
- * @param proc function to call on result
- * @param proc_cls closure for processor
- * @return handle to the operation
- */
-struct GNUNET_GNS_QueueEntry *
-GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle,
- const char * name,
- GNUNET_GNS_GetAuthResultProcessor proc,
- void *proc_cls)
-{
- struct GNUNET_GNS_ClientGetAuthMessage *get_auth_msg;
- struct GNUNET_GNS_QueueEntry *qe;
- size_t msize;
- struct PendingMessage *pending;
-
- if (NULL == name)