From 37bf467121fb638404b4aff5dac42f907e6b47e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philipp=20T=C3=B6lke?= Date: Tue, 5 Oct 2010 18:20:14 +0000 Subject: [PATCH] Remove unnecessary DEBUG-Output --- src/vpn/gnunet-daemon-vpn.c | 12 ++---------- src/vpn/gnunet-service-dns.c | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index a078747a0..1ec5bf758 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c @@ -117,7 +117,7 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts int t = GNUNET_DISK_file_read(mycls.fh_from_helper, &buf, 65535); if (t<=0) { - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Read error for header: %m\n"); + GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Read error for header from vpn-helper: %m\n"); GNUNET_SCHEDULER_add_now(mycls.sched, restart_helper, cls); return; } @@ -205,8 +205,6 @@ size_t send_query(void* cls, size_t size, void* buf) memcpy(buf, &query->pkt.hdr, len); - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sent %d bytes.\n", len); - GNUNET_CONTAINER_DLL_remove (mycls.head, mycls.tail, query); GNUNET_free(query); @@ -258,11 +256,7 @@ static void message_token(void *cls, void *client, const struct GNUNET_MessageHe GNUNET_CONTAINER_DLL_insert_after(mycls.head, mycls.tail, mycls.tail, query); - struct GNUNET_CLIENT_TransmitHandle* th = GNUNET_CLIENT_notify_transmit_ready(mycls.dns_connection, len, GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL); - if (th != NULL) - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Queued sending of %d bytes.\n", len); - else - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Already queued for %d bytes.\n", len); + /* struct GNUNET_CLIENT_TransmitHandle* th = */ GNUNET_CLIENT_notify_transmit_ready(mycls.dns_connection, len, GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL); } } @@ -270,7 +264,6 @@ static void message_token(void *cls, void *client, const struct GNUNET_MessageHe void dns_answer_handler(void* cls, const struct GNUNET_MessageHeader *msg) { if (msg == NULL) return; - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Got an answer!\n"); if (msg->type != htons(GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS)) goto out; @@ -306,7 +299,6 @@ run (void *cls, mycls.mst = GNUNET_SERVER_mst_create(&message_token, NULL); mycls.dns_connection = GNUNET_CLIENT_connect (sched, "dns", cfg); - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connection: %x\n", mycls.dns_connection); GNUNET_CLIENT_receive(mycls.dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL); diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index 7880bf22e..e40b2c5c4 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c @@ -72,7 +72,6 @@ void unhijack(unsigned short port) { void receive_query(void *cls, struct GNUNET_SERVER_Client *client, const struct GNUNET_MessageHeader *message) { struct query_packet* pkt = (struct query_packet*)message; - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received query of length %d\n", ntohs(pkt->hdr.size)); struct dns_pkt* dns = (struct dns_pkt*)pkt->data; struct sockaddr_in dest; @@ -85,8 +84,7 @@ void receive_query(void *cls, struct GNUNET_SERVER_Client *client, const struct query_states[dns->id].local_ip = pkt->orig_from; query_states[dns->id].local_port = pkt->src_port; - int r = GNUNET_NETWORK_socket_sendto(mycls.dnsout, dns, ntohs(pkt->hdr.size) - sizeof(struct query_packet) + 1, (struct sockaddr*) &dest, sizeof dest); - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "send %d bytes to socket\n", r); + /* int r = */ GNUNET_NETWORK_socket_sendto(mycls.dnsout, dns, ntohs(pkt->hdr.size) - sizeof(struct query_packet) + 1, (struct sockaddr*) &dest, sizeof dest); GNUNET_SERVER_receive_done(client, GNUNET_OK); } @@ -99,8 +97,6 @@ size_t send_answer(void* cls, size_t size, void* buf) { memcpy(buf, &query->pkt.hdr, len); - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sent %d bytes.\n", len); - GNUNET_CONTAINER_DLL_remove (mycls.head, mycls.tail, query); GNUNET_free(query); @@ -142,11 +138,7 @@ static void read_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext GNUNET_CONTAINER_DLL_insert_after(mycls.head, mycls.tail, mycls.tail, answer); - struct GNUNET_CONNECTION_TransmitHandle* th = GNUNET_SERVER_notify_transmit_ready(query_states[dns->id].client, len, GNUNET_TIME_UNIT_FOREVER_REL, &send_answer, query_states[dns->id].client); - if (th != NULL) - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Queued sending of %d bytes.\n", len); - else - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Already queued for %d bytes.\n", len); + /* struct GNUNET_CONNECTION_TransmitHandle* th = */ GNUNET_SERVER_notify_transmit_ready(query_states[dns->id].client, len, GNUNET_TIME_UNIT_FOREVER_REL, &send_answer, query_states[dns->id].client); } GNUNET_SCHEDULER_add_read_net(mycls.sched, GNUNET_TIME_UNIT_FOREVER_REL, mycls.dnsout, &read_response, NULL); -- 2.25.1