diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-06-15 07:15:49 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-06-15 07:15:49 +0000 |
commit | 7d47ce6fcc921836f56fa71934649e1393d2d838 (patch) | |
tree | 88c1532b7b06fd17e6bb3ed7f1286ddd4aa85239 | |
parent | c1d8488cc700dc12c9647140150c52a88bd6b666 (diff) | |
download | gnunet-7d47ce6fcc921836f56fa71934649e1393d2d838.tar.gz gnunet-7d47ce6fcc921836f56fa71934649e1393d2d838.zip |
debug reception of dns-answers
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index ae2e287f3..715ee3d6e 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c | |||
@@ -239,8 +239,8 @@ mesh_send (void *cls, size_t size, void *buf) | |||
239 | 239 | ||
240 | void mesh_connect (void* cls, const struct GNUNET_PeerIdentity* peer, const struct GNUNET_TRANSPORT_ATS_Information *atsi __attribute__((unused))) { | 240 | void mesh_connect (void* cls, const struct GNUNET_PeerIdentity* peer, const struct GNUNET_TRANSPORT_ATS_Information *atsi __attribute__((unused))) { |
241 | if (NULL == peer) return; | 241 | if (NULL == peer) return; |
242 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s\n", GNUNET_i2s(peer)); | ||
243 | struct tunnel_cls *cls_ = (struct tunnel_cls*)cls; | 242 | struct tunnel_cls *cls_ = (struct tunnel_cls*)cls; |
243 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s, sending query with id %d\n", GNUNET_i2s(peer), ntohs(cls_->dns.s.id)); | ||
244 | 244 | ||
245 | GNUNET_MESH_notify_transmit_ready(cls_->tunnel, | 245 | GNUNET_MESH_notify_transmit_ready(cls_->tunnel, |
246 | GNUNET_YES, | 246 | GNUNET_YES, |
@@ -303,7 +303,7 @@ static int | |||
303 | receive_mesh_answer (void *cls __attribute__((unused)), | 303 | receive_mesh_answer (void *cls __attribute__((unused)), |
304 | struct GNUNET_MESH_Tunnel *tunnel, | 304 | struct GNUNET_MESH_Tunnel *tunnel, |
305 | void **ctx __attribute__((unused)), | 305 | void **ctx __attribute__((unused)), |
306 | const struct GNUNET_PeerIdentity *sender __attribute__((unused)), | 306 | const struct GNUNET_PeerIdentity *sender, |
307 | const struct GNUNET_MessageHeader *message, | 307 | const struct GNUNET_MessageHeader *message, |
308 | const struct GNUNET_TRANSPORT_ATS_Information *atsi __attribute__((unused))) | 308 | const struct GNUNET_TRANSPORT_ATS_Information *atsi __attribute__((unused))) |
309 | { | 309 | { |
@@ -318,6 +318,8 @@ receive_mesh_answer (void *cls __attribute__((unused)), | |||
318 | return GNUNET_SYSERR; | 318 | return GNUNET_SYSERR; |
319 | query_states[dns->s.id].valid = GNUNET_NO; | 319 | query_states[dns->s.id].valid = GNUNET_NO; |
320 | 320 | ||
321 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received answer from peer %s, dns-id %d\n", GNUNET_i2s(sender), ntohs(dns->s.id)); | ||
322 | |||
321 | size_t len = sizeof (struct answer_packet) - 1 + sizeof (struct dns_static) + query_states[dns->s.id].namelen + sizeof (struct dns_query_line) + 2 /* To hold the pointer (as defined in RFC1035) to the name */ | 323 | size_t len = sizeof (struct answer_packet) - 1 + sizeof (struct dns_static) + query_states[dns->s.id].namelen + sizeof (struct dns_query_line) + 2 /* To hold the pointer (as defined in RFC1035) to the name */ |
322 | + sizeof (struct dns_record_line) - 1 + 16; /* To hold the IPv6-Address */ | 324 | + sizeof (struct dns_record_line) - 1 + 16; /* To hold the IPv6-Address */ |
323 | 325 | ||
@@ -333,6 +335,7 @@ receive_mesh_answer (void *cls __attribute__((unused)), | |||
333 | 335 | ||
334 | if (ntohs(pdns->s.ancount) < 1) | 336 | if (ntohs(pdns->s.ancount) < 1) |
335 | { | 337 | { |
338 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Answer only contains %d answers.\n", ntohs(pdns->s.ancount)); | ||
336 | free_parsed_dns_packet(pdns); | 339 | free_parsed_dns_packet(pdns); |
337 | return GNUNET_OK; | 340 | return GNUNET_OK; |
338 | } | 341 | } |
@@ -393,6 +396,8 @@ receive_mesh_answer (void *cls __attribute__((unused)), | |||
393 | &send_answer, | 396 | &send_answer, |
394 | query_states[dns->s.id].client); | 397 | query_states[dns->s.id].client); |
395 | 398 | ||
399 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sent answer on to client\n"); | ||
400 | |||
396 | free_parsed_dns_packet(pdns); | 401 | free_parsed_dns_packet(pdns); |
397 | return GNUNET_OK; | 402 | return GNUNET_OK; |
398 | } | 403 | } |