fix
[oweals/gnunet.git] / src / dht / gnunet-service-dht.c
index bb23153edf24d34259f92b8a0c8bcfc93030d204..454dfe5814c638301ec11ac58e59a5ff201593e3 100644 (file)
@@ -1829,8 +1829,7 @@ schedule_ping_messages ()
  *
  * @param peer the peer identity of the peer being added
  * @param bucket the bucket that we want this peer to go in
- * @param latency transport latency of this peer
- * @param distance transport distance to this peer
+ * @param atsi transport ATS information
  *
  * @return NULL if the peer was not added,
  *         pointer to PeerInfo for new peer otherwise
@@ -1952,6 +1951,7 @@ add_pending_message (struct ClientList *client,
  * @param client the client to send the reply to
  * @param message the encapsulated message to send
  * @param uid the unique identifier of this request
+ * @param key key
  */
 static void
 send_reply_to_client (struct ClientList *client,
@@ -3176,6 +3176,7 @@ compare_peers (const void *p1, const void *p2)
  *
  * @param target the key we are selecting a peer to route to
  * @param bloom a bloomfilter containing entries this request has seen already
+ * @param hops how many hops has this message traversed thus far
  *
  * @return Peer to route to, or NULL on error
  */
@@ -3589,7 +3590,10 @@ cache_response (struct DHT_MessageContext *msg_ctx)
           GNUNET_free (record);
         }
       if (source_info->delete_task != GNUNET_SCHEDULER_NO_TASK)
-        GNUNET_SCHEDULER_cancel (source_info->delete_task);
+       {
+         GNUNET_SCHEDULER_cancel (source_info->delete_task);
+         source_info->delete_task = GNUNET_SCHEDULER_NO_TASK;
+       }
       if (source_info->find_peers_responded != NULL)
         GNUNET_CONTAINER_bloomfilter_free (source_info->find_peers_responded);
       GNUNET_free (source_info);
@@ -4047,8 +4051,10 @@ find_client_records (void *cls, const GNUNET_HashCode * key, void *value)
       GNUNET_CONTAINER_DLL_remove (record->head, record->tail, pos);
       GNUNET_CONTAINER_heap_remove_node (forward_list.minHeap, pos->hnode);
       if (pos->delete_task != GNUNET_SCHEDULER_NO_TASK)
-        GNUNET_SCHEDULER_cancel (pos->delete_task);
-
+       {
+         GNUNET_SCHEDULER_cancel (pos->delete_task);
+         pos->delete_task = GNUNET_SCHEDULER_NO_TASK;
+       }
       if (pos->find_peers_responded != NULL)
         GNUNET_CONTAINER_bloomfilter_free (pos->find_peers_responded);
       GNUNET_free (pos);
@@ -4585,10 +4591,9 @@ handle_dht_local_route_stop (void *cls, struct GNUNET_SERVER_Client *client,
           /* If the client is non-null (local request) and the client matches the requesting client, remove the entry. */
           if ((pos->client != NULL) && (pos->client->client_handle == client))
             {
-              GNUNET_SCHEDULER_cancel (pos->delete_task);
-              pos->delete_task = GNUNET_SCHEDULER_NO_TASK;
-              GNUNET_SCHEDULER_add_continuation (&remove_forward_entry, pos,
-                                                 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+             if (pos->delete_task != GNUNET_SCHEDULER_NO_TASK)
+               GNUNET_SCHEDULER_cancel (pos->delete_task);
+              pos->delete_task = GNUNET_SCHEDULER_add_now (&remove_forward_entry, pos);
             }
           pos = pos->next;
         }
@@ -4600,6 +4605,12 @@ handle_dht_local_route_stop (void *cls, struct GNUNET_SERVER_Client *client,
 
 /**
  * Core handler for p2p route requests.
+ *
+ * @param cls closure
+ * @param message message
+ * @param peer peer identity this notification is about
+ * @param atsi performance data
+ *
  */
 static int
 handle_dht_p2p_route_request (void *cls,
@@ -4698,6 +4709,12 @@ handle_dht_p2p_route_request (void *cls,
 
 /**
  * Core handler for p2p route results.
+ *
+ * @param cls closure
+ * @param message message
+ * @param peer peer identity this notification is about
+ * @param atsi performance data
+ *
  */
 static int
 handle_dht_p2p_route_result (void *cls,