remove SHA-512 code, use libgcrypt implementation
[oweals/gnunet.git] / src / dht / dht_api.c
index d7c05684caeea82fbe9db2cf381d23230543723e..17a21568197d450841debff7a6e95edab88131bb 100644 (file)
@@ -365,9 +365,10 @@ transmit_pending (void *cls,
     }
   if (NULL != head->cont)
     {
-      GNUNET_SCHEDULER_add_now (handle->sched,
-                               head->cont,
-                               head->cont_cls);                             
+      GNUNET_SCHEDULER_add_continuation (handle->sched,
+                                         head->cont,
+                                         head->cont_cls,
+                                         GNUNET_SCHEDULER_REASON_PREREQ_DONE);
       head->cont = NULL;
       head->cont_cls = NULL;
     }
@@ -602,7 +603,7 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle)
 
 
 
-/* ***** Special low-level API providing generic routeing abstraction ***** */
+/* ***** Special low-level API providing generic routing abstraction ***** */
 
 
 /**
@@ -693,7 +694,10 @@ GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle,
   message->key = *key;
   message->options = htonl ((uint32_t) options);
   message->desired_replication_level = htonl (desired_replication_level);
+  handle->uid_gen++;
+  message->unique_id = GNUNET_htonll (handle->uid_gen);
   memcpy (&message[1], enc, esize);
+
   if (iter != NULL)
     {
       route_handle = GNUNET_malloc (sizeof (struct GNUNET_DHT_RouteHandle));
@@ -701,9 +705,8 @@ GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle,
       route_handle->iter = iter;
       route_handle->iter_cls = iter_cls;
       route_handle->dht_handle = handle;
-      route_handle->uid = handle->uid_gen++;
+      route_handle->uid = handle->uid_gen;
       route_handle->message = pending;
-      message->unique_id = GNUNET_htonll (route_handle->uid);
       GNUNET_CONTAINER_multihashmap_put (handle->active_requests,
                                          key,
                                         route_handle,