Module: sip-router
Branch: master
Commit: e68d92a1b05d3df9c1c3a6ac8c1447a4ea2f7932
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e68d92a…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Wed Jun 16 16:09:31 2010 +0200
dns_cache: remove unused err_flags variable
err_flags is deleted from the dns_rr structure.
This flag was checked sometimes, but its value was never
set. Anyway, this flag contained duplicated information
because the parent structure, dns_hash_entry, has a similar
flag (ent_flags & DNS_FLAG_BAD_NAME). And a single hash
entry cannot contain both positive and negative resource
records at the same time.
---
dns_cache.c | 13 +++----------
dns_cache.h | 2 --
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/dns_cache.c b/dns_cache.c
index 32b4e21..c7e4b32 100644
--- a/dns_cache.c
+++ b/dns_cache.c
@@ -2081,7 +2081,7 @@ error:
-/* gets the first non-expired, good record starting with record no
+/* gets the first non-expired record starting with record no
* from the dns_hash_entry struct e
* params: e - dns_hash_entry struct
* *no - it must contain the start record number (0 initially);
@@ -2126,9 +2126,6 @@ inline static struct dns_rr* dns_entry_get_rr( struct
dns_hash_entry* e,
((s_ticks_t)(now-rr->expire)>=0) /* expired rr */
)
continue;
- if (rr->err_flags){ /* bad rr */
- continue;
- }
/* everything is ok now */
*no=n;
return rr;
@@ -2227,7 +2224,6 @@ retry:
#endif
((e->ent_flags & DNS_FLAG_PERMANENT) == 0) &&
((s_ticks_t)(now-rr->expire)>=0) /* expired entry */) ||
- (rr->err_flags) /* bad rr */ ||
(srv_marked(tried, idx)) ) /* already tried */{
r_sums[idx].r_sum=0; /* 0 sum, to skip over it */
r_sums[idx].rr=0; /* debug: mark it as unused */
@@ -3689,10 +3685,9 @@ void dns_cache_debug_all(rpc_t* rpc, void* ctx)
default:
rpc->add(ctx, "ss", "unknown", "?");
}
- rpc->add(ctx, "dd",
+ rpc->add(ctx, "d",
(int)(s_ticks_t)(rr->expire-now)<0?-1:
- TICKS_TO_S(rr->expire-now),
- (int)rr->err_flags);
+ TICKS_TO_S(rr->expire-now));
}
}
}
@@ -3876,8 +3871,6 @@ void dns_cache_print_entry(rpc_t* rpc, void* ctx, struct
dns_hash_entry* e)
rpc->printf(ctx, "%srr expires in (s): %d", SPACE_FORMAT,
(s_ticks_t)(rr->expire-now)<0?-1 :
TICKS_TO_S(rr->expire-now));
- rpc->printf(ctx, "%srr error flags: %d", SPACE_FORMAT,
- rr->err_flags);
}
}
diff --git a/dns_cache.h b/dns_cache.h
index e45d76c..06e00a7 100644
--- a/dns_cache.h
+++ b/dns_cache.h
@@ -135,8 +135,6 @@ struct dns_rr{
struct dns_rr* next;
void* rdata; /**< depends on the type */
ticks_t expire; /**< = ttl + crt_time */
- unsigned char err_flags; /**< if 0 everything is ok */
-
};