diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-03-30 12:00:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-03-30 12:00:08 +0000 |
commit | 8c3fae81c1d11165d5bfe0f9b34b73b9cf7ad3db (patch) | |
tree | fc97d3b3e8baaafacd5a312addc88d7c32e936f2 /src/dv | |
parent | afef053a2ee08002fe50f3e1842e5c8153e6c507 (diff) | |
download | gnunet-8c3fae81c1d11165d5bfe0f9b34b73b9cf7ad3db.tar.gz gnunet-8c3fae81c1d11165d5bfe0f9b34b73b9cf7ad3db.zip |
-more logging'
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 7b86eb927..27c1fb445 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -748,11 +748,18 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
748 | { | 748 | { |
749 | GNUNET_break (GNUNET_YES != neighbor->connected); | 749 | GNUNET_break (GNUNET_YES != neighbor->connected); |
750 | neighbor->connected = GNUNET_YES; | 750 | neighbor->connected = GNUNET_YES; |
751 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
752 | "Core connected to %s (distance %u)\n", | ||
753 | GNUNET_i2s (peer), | ||
754 | (unsigned int) neighbor->distance); | ||
751 | if (DIRECT_NEIGHBOR_COST != neighbor->distance) | 755 | if (DIRECT_NEIGHBOR_COST != neighbor->distance) |
752 | return; | 756 | return; |
753 | handle_direct_connect (neighbor); | 757 | handle_direct_connect (neighbor); |
754 | return; | 758 | return; |
755 | } | 759 | } |
760 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
761 | "Core connected to %s (distance unknown)\n", | ||
762 | GNUNET_i2s (peer)); | ||
756 | neighbor = GNUNET_malloc (sizeof (struct DirectNeighbor)); | 763 | neighbor = GNUNET_malloc (sizeof (struct DirectNeighbor)); |
757 | neighbor->peer = *peer; | 764 | neighbor->peer = *peer; |
758 | GNUNET_assert (GNUNET_YES == | 765 | GNUNET_assert (GNUNET_YES == |
@@ -976,9 +983,13 @@ handle_ats_update (void *cls, | |||
976 | if (GNUNET_NO == active) | 983 | if (GNUNET_NO == active) |
977 | return; | 984 | return; |
978 | distance = get_atsi_distance (ats, ats_count); | 985 | distance = get_atsi_distance (ats, ats_count); |
986 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
987 | "ATS says distance to %s is %u\n", | ||
988 | GNUNET_i2s (&address->peer), | ||
989 | (unsigned int) distance); | ||
979 | /* check if entry exists */ | 990 | /* check if entry exists */ |
980 | neighbor = GNUNET_CONTAINER_multihashmap_get (direct_neighbors, | 991 | neighbor = GNUNET_CONTAINER_multihashmap_get (direct_neighbors, |
981 | &address->peer.hashPubKey); | 992 | &address->peer.hashPubKey); |
982 | if (NULL != neighbor) | 993 | if (NULL != neighbor) |
983 | { | 994 | { |
984 | if ( (DIRECT_NEIGHBOR_COST == neighbor->distance) && | 995 | if ( (DIRECT_NEIGHBOR_COST == neighbor->distance) && |
@@ -1048,6 +1059,9 @@ check_target_removed (void *cls, | |||
1048 | return GNUNET_OK; | 1059 | return GNUNET_OK; |
1049 | } | 1060 | } |
1050 | /* remove existing route */ | 1061 | /* remove existing route */ |
1062 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1063 | "Lost route to %s\n", | ||
1064 | GNUNET_i2s (¤t_route->target.peer)); | ||
1051 | GNUNET_assert (GNUNET_YES == | 1065 | GNUNET_assert (GNUNET_YES == |
1052 | GNUNET_CONTAINER_multihashmap_remove (all_routes, key, current_route)); | 1066 | GNUNET_CONTAINER_multihashmap_remove (all_routes, key, current_route)); |
1053 | send_disconnect_to_plugin (¤t_route->target.peer); | 1067 | send_disconnect_to_plugin (¤t_route->target.peer); |
@@ -1108,6 +1122,10 @@ check_target_added (void *cls, | |||
1108 | return GNUNET_OK; | 1122 | return GNUNET_OK; |
1109 | } | 1123 | } |
1110 | /* new route */ | 1124 | /* new route */ |
1125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1126 | "Discovered new route to %s using %u hops\n", | ||
1127 | GNUNET_i2s (&target->peer), | ||
1128 | (unsigned int) (ntohl (target->distance) + 1)); | ||
1111 | current_route = GNUNET_malloc (sizeof (struct Route)); | 1129 | current_route = GNUNET_malloc (sizeof (struct Route)); |
1112 | current_route->next_hop = neighbor; | 1130 | current_route->next_hop = neighbor; |
1113 | current_route->target.peer = target->peer; | 1131 | current_route->target.peer = target->peer; |
@@ -1136,6 +1154,9 @@ consensus_done_cb (void *cls) | |||
1136 | 1154 | ||
1137 | GNUNET_CONSENSUS_destroy (neighbor->consensus); | 1155 | GNUNET_CONSENSUS_destroy (neighbor->consensus); |
1138 | neighbor->consensus = NULL; | 1156 | neighbor->consensus = NULL; |
1157 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1158 | "Finished consensus with %s!\n", | ||
1159 | GNUNET_i2s (&neighbor->peer)); | ||
1139 | /* remove targets that disappeared */ | 1160 | /* remove targets that disappeared */ |
1140 | neighbor->target_removed = GNUNET_NO; | 1161 | neighbor->target_removed = GNUNET_NO; |
1141 | GNUNET_CONTAINER_multihashmap_iterate (neighbor->neighbor_table, | 1162 | GNUNET_CONTAINER_multihashmap_iterate (neighbor->neighbor_table, |
@@ -1291,6 +1312,9 @@ start_consensus (void *cls, | |||
1291 | struct GNUNET_HashCode session_id; | 1312 | struct GNUNET_HashCode session_id; |
1292 | struct GNUNET_HashCode real_session_id; | 1313 | struct GNUNET_HashCode real_session_id; |
1293 | 1314 | ||
1315 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1316 | "Starting to create consensus with %s!\n", | ||
1317 | GNUNET_i2s (&neighbor->peer)); | ||
1294 | neighbor->consensus_task = GNUNET_SCHEDULER_NO_TASK; | 1318 | neighbor->consensus_task = GNUNET_SCHEDULER_NO_TASK; |
1295 | neighbor->consensus_insertion_offset = 0; | 1319 | neighbor->consensus_insertion_offset = 0; |
1296 | neighbor->consensus_insertion_distance = 0; | 1320 | neighbor->consensus_insertion_distance = 0; |
@@ -1370,6 +1394,9 @@ handle_dv_route_message (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1370 | 1, GNUNET_NO); | 1394 | 1, GNUNET_NO); |
1371 | return GNUNET_OK; | 1395 | return GNUNET_OK; |
1372 | } | 1396 | } |
1397 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1398 | "Delivering %u bytes to myself!\n", | ||
1399 | ntohs (payload->size)); | ||
1373 | send_data_to_plugin (payload, | 1400 | send_data_to_plugin (payload, |
1374 | &rm->sender, | 1401 | &rm->sender, |
1375 | ntohl (route->target.distance)); | 1402 | ntohl (route->target.distance)); |
@@ -1444,6 +1471,11 @@ handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
1444 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1471 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1445 | return; | 1472 | return; |
1446 | } | 1473 | } |
1474 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1475 | "Forwarding %u bytes to %s\n", | ||
1476 | ntohs (payload->size), | ||
1477 | GNUNET_i2s (&msg->target)); | ||
1478 | |||
1447 | forward_payload (route->next_hop, | 1479 | forward_payload (route->next_hop, |
1448 | ntohl (route->target.distance), | 1480 | ntohl (route->target.distance), |
1449 | htonl (msg->uid), | 1481 | htonl (msg->uid), |