aboutsummaryrefslogtreecommitdiff
path: root/src/dv/plugin_transport_dv.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-11-19 19:08:37 +0000
committerNathan S. Evans <evans@in.tum.de>2011-11-19 19:08:37 +0000
commitdbaa827eaaeded675980aa2f8f8af87f82923df6 (patch)
treeca8057e0245147461abc350421e50c01036aedd1 /src/dv/plugin_transport_dv.c
parentc5e920135215aa0b59839c2d42190b99214dca24 (diff)
downloadgnunet-dbaa827eaaeded675980aa2f8f8af87f82923df6.tar.gz
gnunet-dbaa827eaaeded675980aa2f8f8af87f82923df6.zip
debugging dv/transport problems
Diffstat (limited to 'src/dv/plugin_transport_dv.c')
-rw-r--r--src/dv/plugin_transport_dv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index 6b585f6cc..569213f72 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -160,18 +160,21 @@ handle_dv_message_received (void *cls, struct GNUNET_PeerIdentity *sender,
160 my_id, GNUNET_i2s (sender), 160 my_id, GNUNET_i2s (sender),
161 ntohs (((struct GNUNET_MessageHeader *) msg)->type), 161 ntohs (((struct GNUNET_MessageHeader *) msg)->type),
162 distance); 162 distance);
163 if (sender_address_len == (2 * sizeof(struct GNUNET_PeerIdentity)))
164 {
165 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "plugin_transport_dv", "Parsed sender address: %s:%s\n", GNUNET_i2s((struct GNUNET_PeerIdentity *)sender_address), GNUNET_h2s(&((struct GNUNET_PeerIdentity *)&sender_address[sizeof(struct GNUNET_PeerIdentity)])->hashPubKey));
166 }
167
163 GNUNET_free_non_null (my_id); 168 GNUNET_free_non_null (my_id);
164#endif 169#endif
165 struct GNUNET_ATS_Information ats[2]; 170 struct GNUNET_ATS_Information ats[1];
166 171
167 ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); 172 ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
168 ats[0].value = htonl (distance); 173 ats[0].value = htonl (distance);
169 ats[1].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
170 ats[1].value = htonl (0);
171 174
172 plugin->env->receive (plugin->env->cls, sender, 175 plugin->env->receive (plugin->env->cls, sender,
173 (struct GNUNET_MessageHeader *) msg, 176 (struct GNUNET_MessageHeader *) msg,
174 (const struct GNUNET_ATS_Information *) &ats, 2, NULL, 177 (const struct GNUNET_ATS_Information *) &ats, 1, NULL,
175 sender_address, sender_address_len); 178 sender_address, sender_address_len);
176 179
177} 180}
@@ -367,6 +370,7 @@ dv_plugin_check_address (void *cls, const void *addr, size_t addrlen)
367 } 370 }
368 return GNUNET_SYSERR; 371 return GNUNET_SYSERR;
369 } 372 }
373
370 return GNUNET_OK; 374 return GNUNET_OK;
371} 375}
372 376