diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-24 13:15:34 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-24 13:15:34 +0000 |
commit | b657bebb43db87fa162ed44465bb4a0b6cd9165f (patch) | |
tree | 9304241488c3f3c2361cb3927f9419209a060a45 /src/dv | |
parent | e65e2c0c6d98fe908f1af003a77236f134c70eeb (diff) | |
download | gnunet-b657bebb43db87fa162ed44465bb4a0b6cd9165f.tar.gz gnunet-b657bebb43db87fa162ed44465bb4a0b6cd9165f.zip |
hello size added to debug
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 2647e3482..f5ce2e16c 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -2200,8 +2200,6 @@ generate_hello_address (void *cls, size_t max, void *buf) | |||
2200 | size_t offset; | 2200 | size_t offset; |
2201 | size_t size; | 2201 | size_t size; |
2202 | size_t ret; | 2202 | size_t ret; |
2203 | char *addr1; | ||
2204 | char *addr2; | ||
2205 | 2203 | ||
2206 | if (hello_context->addresses_to_add == 0) | 2204 | if (hello_context->addresses_to_add == 0) |
2207 | return 0; | 2205 | return 0; |
@@ -2217,11 +2215,6 @@ generate_hello_address (void *cls, size_t max, void *buf) | |||
2217 | offset += sizeof(struct GNUNET_PeerIdentity); | 2215 | offset += sizeof(struct GNUNET_PeerIdentity); |
2218 | /* Copy the direct peer identity to buffer */ | 2216 | /* Copy the direct peer identity to buffer */ |
2219 | memcpy(&addr_buffer[offset], hello_context->direct_peer, sizeof(struct GNUNET_PeerIdentity)); | 2217 | memcpy(&addr_buffer[offset], hello_context->direct_peer, sizeof(struct GNUNET_PeerIdentity)); |
2220 | addr1 = GNUNET_strdup(GNUNET_i2s(hello_context->direct_peer)); | ||
2221 | addr2 = GNUNET_strdup(GNUNET_i2s(&hello_context->distant_peer)); | ||
2222 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: GIVING HELLO for %s via %s to TRANSPORT\n", my_short_id, addr2, addr1); | ||
2223 | GNUNET_free(addr1); | ||
2224 | GNUNET_free(addr2); | ||
2225 | ret = GNUNET_HELLO_add_address ("dv", | 2218 | ret = GNUNET_HELLO_add_address ("dv", |
2226 | GNUNET_TIME_relative_to_absolute | 2219 | GNUNET_TIME_relative_to_absolute |
2227 | (GNUNET_TIME_UNIT_HOURS), addr_buffer, size, | 2220 | (GNUNET_TIME_UNIT_HOURS), addr_buffer, size, |
@@ -2260,6 +2253,8 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity * peer, struct GNUNET_CRYPTO | |||
2260 | struct HelloContext *hello_context; | 2253 | struct HelloContext *hello_context; |
2261 | struct GNUNET_HELLO_Message *hello_msg; | 2254 | struct GNUNET_HELLO_Message *hello_msg; |
2262 | unsigned int our_id; | 2255 | unsigned int our_id; |
2256 | char *addr1; | ||
2257 | char *addr2; | ||
2263 | 2258 | ||
2264 | #if DEBUG_DV_PEER_NUMBERS | 2259 | #if DEBUG_DV_PEER_NUMBERS |
2265 | char *encAbout; | 2260 | char *encAbout; |
@@ -2386,6 +2381,11 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity * peer, struct GNUNET_CRYPTO | |||
2386 | hello_context->addresses_to_add = 1; | 2381 | hello_context->addresses_to_add = 1; |
2387 | hello_msg = GNUNET_HELLO_create(pkey, &generate_hello_address, hello_context); | 2382 | hello_msg = GNUNET_HELLO_create(pkey, &generate_hello_address, hello_context); |
2388 | GNUNET_assert(memcmp(hello_context->direct_peer, &hello_context->distant_peer, sizeof(struct GNUNET_PeerIdentity)) != 0); | 2383 | GNUNET_assert(memcmp(hello_context->direct_peer, &hello_context->distant_peer, sizeof(struct GNUNET_PeerIdentity)) != 0); |
2384 | addr1 = GNUNET_strdup(GNUNET_i2s(hello_context->direct_peer)); | ||
2385 | addr2 = GNUNET_strdup(GNUNET_i2s(&hello_context->distant_peer)); | ||
2386 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: GIVING HELLO size %d for %s via %s to TRANSPORT\n", my_short_id, GNUNET_HELLO_size(hello_msg), addr2, addr1); | ||
2387 | GNUNET_free(addr1); | ||
2388 | GNUNET_free(addr2); | ||
2389 | send_to_plugin(hello_context->direct_peer, GNUNET_HELLO_get_header(hello_msg), GNUNET_HELLO_size(hello_msg), &hello_context->distant_peer, cost); | 2389 | send_to_plugin(hello_context->direct_peer, GNUNET_HELLO_get_header(hello_msg), GNUNET_HELLO_size(hello_msg), &hello_context->distant_peer, cost); |
2390 | GNUNET_free(hello_context); | 2390 | GNUNET_free(hello_context); |
2391 | GNUNET_free(hello_msg); | 2391 | GNUNET_free(hello_msg); |