diff options
author | Supriti Singh <supritisingh08@gmail.com> | 2014-09-22 18:42:20 +0000 |
---|---|---|
committer | Supriti Singh <supritisingh08@gmail.com> | 2014-09-22 18:42:20 +0000 |
commit | 10cde48d456de8d42e8a315a95ea0f846894efea (patch) | |
tree | bf8f47cc3ddd67b8d2fcb06d05541a9575fb3fa1 /src/dht | |
parent | 1a021fccfa0554a6396f1114f11ef509c49712fc (diff) | |
download | gnunet-10cde48d456de8d42e8a315a95ea0f846894efea.tar.gz gnunet-10cde48d456de8d42e8a315a95ea0f846894efea.zip |
xvine: better log prints
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 24 | ||||
-rw-r--r-- | src/dht/gnunet_dht_profiler.c | 2 |
2 files changed, 5 insertions, 21 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index c7e99c2e7..83d76b073 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -2269,6 +2269,7 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key, | |||
2269 | 2269 | ||
2270 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity)) | 2270 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity)) |
2271 | { | 2271 | { |
2272 | DEBUG("\n PUT_REQUEST_SUCCESSFUL for key = %s",GNUNET_h2s(key)); | ||
2272 | /* I am the destination. */ | 2273 | /* I am the destination. */ |
2273 | GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL, | 2274 | GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL, |
2274 | block_type,data_size,data); | 2275 | block_type,data_size,data); |
@@ -2278,7 +2279,6 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key, | |||
2278 | key, data, data_size); | 2279 | key, data, data_size); |
2279 | return; | 2280 | return; |
2280 | } | 2281 | } |
2281 | DEBUG("\n PUT_REQUEST_RECEVIED for key = %s, act_malicious = %d",GNUNET_h2s(key),act_malicious); | ||
2282 | /* In case we are sending the request to a finger, then send across all of its | 2282 | /* In case we are sending the request to a finger, then send across all of its |
2283 | trail.*/ | 2283 | trail.*/ |
2284 | #if ENABLE_MALICIOUS | 2284 | #if ENABLE_MALICIOUS |
@@ -2295,8 +2295,6 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key, | |||
2295 | { | 2295 | { |
2296 | if(0 == next_hop_finger->trail_list[i].trail_length) | 2296 | if(0 == next_hop_finger->trail_list[i].trail_length) |
2297 | { | 2297 | { |
2298 | DEBUG("\n PUT_REQUEST = %s TRAIL LENGTH = 0 NOT SENDING ACROSS MULTIPLE TRAILS,next_hop = %s", GNUNET_h2s(key), | ||
2299 | GNUNET_i2s(&next_hop)); | ||
2300 | GDS_NEIGHBOURS_send_put (key, block_type, options, desired_replication_level, | 2298 | GDS_NEIGHBOURS_send_put (key, block_type, options, desired_replication_level, |
2301 | best_known_dest, intermediate_trail_id, &next_hop, | 2299 | best_known_dest, intermediate_trail_id, &next_hop, |
2302 | 0, 1, &my_identity, expiration_time, | 2300 | 0, 1, &my_identity, expiration_time, |
@@ -2304,9 +2302,6 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key, | |||
2304 | return; | 2302 | return; |
2305 | } | 2303 | } |
2306 | next_hop = next_hop_finger->trail_list[i].trail_head->peer; | 2304 | next_hop = next_hop_finger->trail_list[i].trail_head->peer; |
2307 | DEBUG("\n PUT_REQUEST = %s SENDING ACROSS TRAIL_ID = %s, next_hop = %s", | ||
2308 | GNUNET_h2s(key),GNUNET_h2s(&next_hop_finger->trail_list[i].trail_id), | ||
2309 | GNUNET_i2s(&next_hop)); | ||
2310 | GDS_NEIGHBOURS_send_put (key, block_type, options, desired_replication_level, | 2305 | GDS_NEIGHBOURS_send_put (key, block_type, options, desired_replication_level, |
2311 | best_known_dest, | 2306 | best_known_dest, |
2312 | next_hop_finger->trail_list[i].trail_id, | 2307 | next_hop_finger->trail_list[i].trail_id, |
@@ -2318,8 +2313,6 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key, | |||
2318 | return; | 2313 | return; |
2319 | } | 2314 | } |
2320 | #endif | 2315 | #endif |
2321 | DEBUG("\n PUT_REQUEST = %s NOT SENDING ACROSS MULTIPLE TRAILS next_hop = %s", | ||
2322 | GNUNET_h2s(key), GNUNET_i2s(&next_hop)); | ||
2323 | GDS_NEIGHBOURS_send_put (key, block_type, options, desired_replication_level, | 2316 | GDS_NEIGHBOURS_send_put (key, block_type, options, desired_replication_level, |
2324 | best_known_dest, intermediate_trail_id, &next_hop, | 2317 | best_known_dest, intermediate_trail_id, &next_hop, |
2325 | 0, 1, &my_identity, expiration_time, | 2318 | 0, 1, &my_identity, expiration_time, |
@@ -3640,8 +3633,6 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity, | |||
3640 | 3633 | ||
3641 | 3634 | ||
3642 | /** | 3635 | /** |
3643 | * FIXME: Check for loop in the request. If you already are part of put path, | ||
3644 | * then you need to reset the put path length. | ||
3645 | * Core handler for P2P put messages. | 3636 | * Core handler for P2P put messages. |
3646 | * @param cls closure | 3637 | * @param cls closure |
3647 | * @param peer sender of the request | 3638 | * @param peer sender of the request |
@@ -3688,11 +3679,10 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3688 | GNUNET_break_op (0); | 3679 | GNUNET_break_op (0); |
3689 | return GNUNET_OK; | 3680 | return GNUNET_OK; |
3690 | } | 3681 | } |
3691 | DEBUG("\n PUT_REQUEST_RECEVIED for key = %s, my_id = %s",GNUNET_h2s(&put->key),GNUNET_i2s(&my_identity)); | ||
3692 | #if ENABLE_MALICIOUS | 3682 | #if ENABLE_MALICIOUS |
3693 | if(1 == act_malicious) | 3683 | if(1 == act_malicious) |
3694 | { | 3684 | { |
3695 | DEBUG("\n I AM MALICIOUS PUT_REQUEST_RECEVIED for key = %s, my_id = %s",GNUNET_h2s(&put->key),GNUNET_i2s(&my_identity)); | 3685 | DEBUG("\n I AM MALICIOUS PUT_REQUEST_DROPPED for key = %ss",GNUNET_h2s(&put->key)); |
3696 | return GNUNET_OK; | 3686 | return GNUNET_OK; |
3697 | } | 3687 | } |
3698 | #endif | 3688 | #endif |
@@ -3816,6 +3806,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3816 | /* I am the final destination */ | 3806 | /* I am the final destination */ |
3817 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &best_known_dest)) | 3807 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &best_known_dest)) |
3818 | { | 3808 | { |
3809 | DEBUG("\n PUT_REQUEST_SUCCESSFUL for key = %s",GNUNET_h2s(&put->key)); | ||
3819 | GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), | 3810 | GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), |
3820 | &(put->key),putlen, pp, ntohl (put->block_type), | 3811 | &(put->key),putlen, pp, ntohl (put->block_type), |
3821 | payload_size, payload); | 3812 | payload_size, payload); |
@@ -3836,7 +3827,6 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3836 | { | 3827 | { |
3837 | if(0 == next_hop_finger->trail_list[i].trail_length) | 3828 | if(0 == next_hop_finger->trail_list[i].trail_length) |
3838 | { | 3829 | { |
3839 | DEBUG("\n PUT_REQUEST_RECEVIED for key = %s, next_hop = %s,TRAIL LENGTH IS 0",GNUNET_h2s(&put->key),GNUNET_i2s(next_hop)); | ||
3840 | GDS_NEIGHBOURS_send_put (&put->key, | 3830 | GDS_NEIGHBOURS_send_put (&put->key, |
3841 | ntohl (put->block_type),ntohl (put->options), | 3831 | ntohl (put->block_type),ntohl (put->options), |
3842 | ntohl (put->desired_replication_level), | 3832 | ntohl (put->desired_replication_level), |
@@ -3847,9 +3837,6 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3847 | return GNUNET_OK; | 3837 | return GNUNET_OK; |
3848 | } | 3838 | } |
3849 | next_hop = &next_hop_finger->trail_list[i].trail_head->peer; | 3839 | next_hop = &next_hop_finger->trail_list[i].trail_head->peer; |
3850 | DEBUG("\n PUT_REQUEST = %s SENDING ACROSS TRAIL_ID = %s, next_hop = %s", | ||
3851 | GNUNET_h2s(&put->key),GNUNET_h2s(&next_hop_finger->trail_list[i].trail_id), | ||
3852 | GNUNET_i2s(next_hop)); | ||
3853 | GDS_NEIGHBOURS_send_put (&put->key, | 3840 | GDS_NEIGHBOURS_send_put (&put->key, |
3854 | ntohl (put->block_type),ntohl (put->options), | 3841 | ntohl (put->block_type),ntohl (put->options), |
3855 | ntohl (put->desired_replication_level), | 3842 | ntohl (put->desired_replication_level), |
@@ -3863,8 +3850,6 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3863 | return GNUNET_OK; | 3850 | return GNUNET_OK; |
3864 | } | 3851 | } |
3865 | #endif | 3852 | #endif |
3866 | DEBUG("\n PUT_REQUEST = %s NOT SENDING ACROSS MULTIPLE TRAILS next_hop = %s", | ||
3867 | GNUNET_h2s(&put->key), GNUNET_i2s(next_hop)); | ||
3868 | GDS_NEIGHBOURS_send_put (&put->key, | 3853 | GDS_NEIGHBOURS_send_put (&put->key, |
3869 | ntohl (put->block_type),ntohl (put->options), | 3854 | ntohl (put->block_type),ntohl (put->options), |
3870 | ntohl (put->desired_replication_level), | 3855 | ntohl (put->desired_replication_level), |
@@ -3928,7 +3913,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3928 | #if ENABLE_MALICIOUS | 3913 | #if ENABLE_MALICIOUS |
3929 | if(1 == act_malicious) | 3914 | if(1 == act_malicious) |
3930 | { | 3915 | { |
3931 | DEBUG("I am malicious,dropping get request. \n"); | 3916 | DEBUG("I am malicious,GET_REQUEST_DROPPED for key = %s. \n",GNUNET_h2s(&get->key)); |
3932 | return GNUNET_OK; | 3917 | return GNUNET_OK; |
3933 | } | 3918 | } |
3934 | #endif | 3919 | #endif |
@@ -3992,6 +3977,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3992 | { | 3977 | { |
3993 | if (1 == get_length) | 3978 | if (1 == get_length) |
3994 | { | 3979 | { |
3980 | DEBUG("\n GET_REQUEST DONE for key = %s",GNUNET_h2s(&get->key)); | ||
3995 | GDS_DATACACHE_handle_get (&(get->key),(get->block_type), NULL, 0, | 3981 | GDS_DATACACHE_handle_get (&(get->key),(get->block_type), NULL, 0, |
3996 | NULL, 0, 1, &my_identity, NULL,&my_identity); | 3982 | NULL, 0, 1, &my_identity, NULL,&my_identity); |
3997 | } | 3983 | } |
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index 0380a82b4..e69307eac 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c | |||
@@ -825,7 +825,6 @@ static void * | |||
825 | dht_connect (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) | 825 | dht_connect (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
826 | { | 826 | { |
827 | n_dht++; | 827 | n_dht++; |
828 | DEBUG("\n Inside dht_connect , n_dht = %u",n_dht); | ||
829 | return GNUNET_DHT_connect (cfg, 10); | 828 | return GNUNET_DHT_connect (cfg, 10); |
830 | } | 829 | } |
831 | 830 | ||
@@ -995,7 +994,6 @@ set_malicious() | |||
995 | 994 | ||
996 | for(i = 0; i < n_malicious; i++) | 995 | for(i = 0; i < n_malicious; i++) |
997 | { | 996 | { |
998 | DEBUG("\n Inside loop , i = %u",i); | ||
999 | struct MaliciousContext *mc = &a_mc[i]; | 997 | struct MaliciousContext *mc = &a_mc[i]; |
1000 | mc->ctx->op = | 998 | mc->ctx->op = |
1001 | GNUNET_TESTBED_service_connect (mc->ctx, | 999 | GNUNET_TESTBED_service_connect (mc->ctx, |