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;
}
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);
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);
}
}
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;
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);
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;
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);
}
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);
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);