From 677fdd9cd9464cd443722a197ede640fc4be2c95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philipp=20T=C3=B6lke?= Date: Tue, 19 Oct 2010 21:16:48 +0000 Subject: [PATCH] less magic numbers --- src/vpn/gnunet-service-dns.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index 941593979..750f81cef 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c @@ -125,7 +125,7 @@ void receive_query(void *cls, struct GNUNET_SERVER_Client *client, const struct struct dns_pkt* dns = (struct dns_pkt*)pkt->data; struct dns_pkt_parsed* pdns = parse_dns_packet(dns); - query_states[dns->s.id].valid = 1; + query_states[dns->s.id].valid = GNUNET_YES; query_states[dns->s.id].client = client; query_states[dns->s.id].local_ip = pkt->orig_from; query_states[dns->s.id].local_port = pkt->src_port; @@ -204,8 +204,8 @@ static void read_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext /* if (r < 0) TODO */ - if (query_states[dns->s.id].valid == 1) { - query_states[dns->s.id].valid = 0; + if (query_states[dns->s.id].valid == GNUNET_YES) { + query_states[dns->s.id].valid = GNUNET_NO; size_t len = sizeof(struct answer_packet) + r - 1; /* 1 for the unsigned char data[1]; */ struct answer_packet_list* answer = GNUNET_malloc(len + 2*sizeof(struct answer_packet_list*)); @@ -295,7 +295,7 @@ run (void *cls, { int i; for (i = 0; i < 65536; i++) { - query_states[i].valid = 0; + query_states[i].valid = GNUNET_NO; } } -- 2.25.1