From 3ef49aae956c39eab2062d0bffbe1d3e971329a0 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Thu, 7 Oct 2010 09:10:42 +0000 Subject: unique id is quite useful for the dht, even for puts --- src/dht/dht_api.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dht/dht_api.c') diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 561aa0a77..17a215681 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -694,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)); @@ -702,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, -- cgit v1.2.3