aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-24 16:52:09 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-24 16:52:09 +0000
commit8fa1470671e28f9bd48aae3670e631525bfd895e (patch)
tree9c5da081f92bf47e4553c03639c853c17456c8c5 /src/dht
parent7f0b9b87f1f1fba7924bdf8082196cf24b6651c8 (diff)
downloadgnunet-8fa1470671e28f9bd48aae3670e631525bfd895e.tar.gz
gnunet-8fa1470671e28f9bd48aae3670e631525bfd895e.zip
log local operations
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_clients.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index ad16ddc3f..aa2fd9462 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -248,6 +248,10 @@ remove_client_records (void *cls, const GNUNET_HashCode * key, void *value)
248 248
249 if (record->client != client) 249 if (record->client != client)
250 return GNUNET_YES; 250 return GNUNET_YES;
251 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
252 "Removing client %p's record for key %s\n",
253 client,
254 GNUNET_h2s (key));
251 GNUNET_assert (GNUNET_YES == 255 GNUNET_assert (GNUNET_YES ==
252 GNUNET_CONTAINER_multihashmap_remove (forward_map, 256 GNUNET_CONTAINER_multihashmap_remove (forward_map,
253 key, record)); 257 key, record));
@@ -276,6 +280,9 @@ handle_client_disconnect (void *cls,
276 struct ClientList *pos; 280 struct ClientList *pos;
277 struct PendingMessage *reply; 281 struct PendingMessage *reply;
278 282
283 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
284 "Local client %p disconnects\n",
285 client);
279 pos = find_active_client (client); 286 pos = find_active_client (client);
280 GNUNET_CONTAINER_DLL_remove (client_head, 287 GNUNET_CONTAINER_DLL_remove (client_head,
281 client_tail, 288 client_tail,
@@ -473,8 +480,9 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
473 gettext_noop ("# GET requests received from clients"), 1, 480 gettext_noop ("# GET requests received from clients"), 1,
474 GNUNET_NO); 481 GNUNET_NO);
475 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 482 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
476 "Received request for %s from local client\n", 483 "Received request for %s from local client %p\n",
477 GNUNET_h2s (&get->key)); 484 GNUNET_h2s (&get->key),
485 client);
478 cqr = GNUNET_malloc (sizeof (struct ClientQueryRecord) + xquery_size); 486 cqr = GNUNET_malloc (sizeof (struct ClientQueryRecord) + xquery_size);
479 cqr->key = get->key; 487 cqr->key = get->key;
480 cqr->client = find_active_client (client); 488 cqr->client = find_active_client (client);
@@ -538,6 +546,10 @@ remove_by_unique_id (void *cls, const GNUNET_HashCode * key, void *value)
538 546
539 if (record->unique_id != ctx->unique_id) 547 if (record->unique_id != ctx->unique_id)
540 return GNUNET_YES; 548 return GNUNET_YES;
549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
550 "Removing client %p's record for key %s (by unique id)\n",
551 ctx->client,
552 GNUNET_h2s (key));
541 return remove_client_records (ctx->client, key, record); 553 return remove_client_records (ctx->client, key, record);
542} 554}
543 555
@@ -562,6 +574,10 @@ handle_dht_local_get_stop (void *cls, struct GNUNET_SERVER_Client *client,
562 GNUNET_STATISTICS_update (GDS_stats, 574 GNUNET_STATISTICS_update (GDS_stats,
563 gettext_noop ("# GET STOP requests received from clients"), 1, 575 gettext_noop ("# GET STOP requests received from clients"), 1,
564 GNUNET_NO); 576 GNUNET_NO);
577 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
578 "Client %p stopped request for key %s\n",
579 client,
580 GNUNET_h2s (&dht_stop_msg->key));
565 ctx.client = find_active_client (client); 581 ctx.client = find_active_client (client);
566 ctx.unique_id = dht_stop_msg->unique_id; 582 ctx.unique_id = dht_stop_msg->unique_id;
567 GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, 583 GNUNET_CONTAINER_multihashmap_get_multiple (forward_map,
@@ -718,6 +734,9 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value)
718 if ( (record->type != GNUNET_BLOCK_TYPE_ANY) && 734 if ( (record->type != GNUNET_BLOCK_TYPE_ANY) &&
719 (record->type != frc->type) ) 735 (record->type != frc->type) )
720 { 736 {
737 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
738 "Record type missmatch, not passing request for key %s to local client\n",
739 GNUNET_h2s (key));
721 GNUNET_STATISTICS_update (GDS_stats, 740 GNUNET_STATISTICS_update (GDS_stats,
722 gettext_noop ("# Key match, type mismatches in REPLY to CLIENT"), 1, 741 gettext_noop ("# Key match, type mismatches in REPLY to CLIENT"), 1,
723 GNUNET_NO); 742 GNUNET_NO);
@@ -731,6 +750,9 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value)
731 &ch, 750 &ch,
732 sizeof (GNUNET_HashCode))) 751 sizeof (GNUNET_HashCode)))
733 { 752 {
753 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
754 "Duplicate reply, not passing request for key %s to local client\n",
755 GNUNET_h2s (key));
734 GNUNET_STATISTICS_update (GDS_stats, 756 GNUNET_STATISTICS_update (GDS_stats,
735 gettext_noop ("# Duplicate REPLIES to CLIENT request dropped"), 1, 757 gettext_noop ("# Duplicate REPLIES to CLIENT request dropped"), 1,
736 GNUNET_NO); 758 GNUNET_NO);
@@ -744,6 +766,10 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value)
744 record->xquery_size, 766 record->xquery_size,
745 frc->data, 767 frc->data,
746 frc->data_size); 768 frc->data_size);
769 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
770 "Evaluation result is %d for key %s for local client's query\n",
771 (int) eval,
772 GNUNET_h2s (key));
747 switch (eval) 773 switch (eval)
748 { 774 {
749 case GNUNET_BLOCK_EVALUATION_OK_LAST: 775 case GNUNET_BLOCK_EVALUATION_OK_LAST:
@@ -797,6 +823,10 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value)
797 GNUNET_NO); 823 GNUNET_NO);
798 reply = (struct GNUNET_DHT_ClientResultMessage*) &pm[1]; 824 reply = (struct GNUNET_DHT_ClientResultMessage*) &pm[1];
799 reply->unique_id = record->unique_id; 825 reply->unique_id = record->unique_id;
826 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
827 "Queueing reply to query %s for peer %p\n",
828 GNUNET_h2s (key),
829 record->client->client_handle);
800 add_pending_message (record->client, pm); 830 add_pending_message (record->client, pm);
801 if (GNUNET_YES == do_free) 831 if (GNUNET_YES == do_free)
802 remove_client_records (record->client, key, record); 832 remove_client_records (record->client, key, record);