- added check against statistics
[oweals/gnunet.git] / src / gns / gns_api.c
index 5733e1cf347a89c104409cba931e18bda50208ea..4b7d6b9f8a7e6cd742f541da1070e6ece3f5aafe 100644 (file)
@@ -342,9 +342,8 @@ transmit_pending (void *cls, size_t size, void *buf)
  * Process a given reply that might match the given
  * request.
  *
- * @param cls the 'struct GNUNET_GNS_ClientResultMessage'
- * @param key query of the request
- * @param value the 'struct GNUNET_GNS_LookupHandle' of a request matching the same key
+ * @param qe a queue entry
+ * @param msg the shorten msg received
  */
 static void
 process_shorten_reply (struct GNUNET_GNS_QueueEntry *qe,
@@ -418,11 +417,8 @@ process_get_auth_reply (struct GNUNET_GNS_QueueEntry *qe,
 /**
  * Process a given reply to the lookup request
  *
- * @param cls the 'struct GNUNET_GNS_ClientResultMessage'
- * @param key query of the request
- * @param value the 'struct GNUNET_GNS_LookupHandle' of a request matching the same key
- * @return GNUNET_YES to continue to iterate over all results,
- *         GNUNET_NO if the reply is malformed
+ * @param qe a queue entry
+ * @param msg the lookup message received
  */
 static void
 process_lookup_reply (struct GNUNET_GNS_QueueEntry *qe,
@@ -587,7 +583,6 @@ process_message (void *cls, const struct GNUNET_MessageHeader *msg)
  * Initialize the connection with the GNS service.
  *
  * @param cfg configuration to use
- * @param ht_len size of the internal hash table to use for parallel requests
  * @return handle to the GNS service, or NULL on error
  */
 struct GNUNET_GNS_Handle *
@@ -613,15 +608,15 @@ GNUNET_GNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
  * @param handle handle of the GNS connection to stop
  */
 void
-GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *h)
+GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle)
 {
-  GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
-  if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+  GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+  if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
   {
-    GNUNET_SCHEDULER_cancel (h->reconnect_task);
-    h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+    GNUNET_SCHEDULER_cancel (handle->reconnect_task);
+    handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
   }
-  GNUNET_free(h);
+  GNUNET_free(handle);
   /* disco from GNS */
 }
 
@@ -644,9 +639,10 @@ get_request_id (struct GNUNET_GNS_Handle *h)
  *
  * @param handle handle to the GNS service
  * @param name the name to look up
- * @param iter function to call on each result
- * @param iter_cls closure for iter
- * @return handle to stop the async get
+ * @param type the record type to look up
+ * @param proc processor to call on result
+ * @param proc_cls closure for processor
+ * @return handle to the get
  */
 struct GNUNET_GNS_QueueEntry *
 GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
@@ -690,7 +686,7 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
 
   memcpy(&lookup_msg[1], name, strlen(name));
 
-  GNUNET_CONTAINER_DLL_insert (handle->pending_head, handle->pending_tail,
+  GNUNET_CONTAINER_DLL_insert_tail (handle->pending_head, handle->pending_tail,
                                pending);
   
   process_pending_messages (handle);
@@ -747,7 +743,7 @@ GNUNET_GNS_shorten (struct GNUNET_GNS_Handle *handle,
 
   memcpy(&shorten_msg[1], name, strlen(name));
 
-  GNUNET_CONTAINER_DLL_insert (handle->pending_head, handle->pending_tail,
+  GNUNET_CONTAINER_DLL_insert_tail (handle->pending_head, handle->pending_tail,
                                pending);
   
   process_pending_messages (handle);
@@ -804,7 +800,7 @@ GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle,
 
   memcpy(&get_auth_msg[1], name, strlen(name));
 
-  GNUNET_CONTAINER_DLL_insert (handle->pending_head, handle->pending_tail,
+  GNUNET_CONTAINER_DLL_insert_tail (handle->pending_head, handle->pending_tail,
                                pending);
   
   process_pending_messages (handle);