chiark
/
gitweb
/
~mdw
/
adns
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0e45654
)
remove debugging from srv with postsort
author
ian
<ian>
Thu, 6 Apr 2006 18:40:26 +0000
(18:40 +0000)
committer
ian
<ian>
Thu, 6 Apr 2006 18:40:26 +0000
(18:40 +0000)
src/types.c
patch
|
blob
|
blame
|
history
diff --git
a/src/types.c
b/src/types.c
index d39e341e11a06a067ff76e6fc0f8e5b7df384e88..14afc900b3fff77cb646b6056d2477c7afad90ee 100644
(file)
--- a/
src/types.c
+++ b/
src/types.c
@@
-1143,8
+1143,6
@@
static void postsort_srv(adns_state ads, void *array, int nrrs,
workend < arrayend && (rr=(void*)workend)->priority == cpriority;
workend += typei->rrsz) {
totalweight += rr->weight;
workend < arrayend && (rr=(void*)workend)->priority == cpriority;
workend += typei->rrsz) {
totalweight += rr->weight;
-fprintf(stderr,"(postsort_srv priority %d weight %d)\n",
- cpriority, rr->weight);
}
/* Now workbegin..(workend-1) incl. are exactly all of the RRs of
}
/* Now workbegin..(workend-1) incl. are exactly all of the RRs of
@@
-1159,12
+1157,6
@@
fprintf(stderr,"(postsort_srv priority %d weight %d)\n",
randval= nrand48(ads->rand48xsubi);
randval %= (totalweight + 1);
randval= nrand48(ads->rand48xsubi);
randval %= (totalweight + 1);
-fprintf(stderr,"(postsort_srv totalweight %d randval %ld %ld..%ld<%ld)\n",
- totalweight,randval,
- (unsigned long)(workbegin - (char*)array) / typei->rrsz,
- (unsigned long)(workend - (char*)array) / typei->rrsz,
- (unsigned long)(arrayend - (char*)array) / typei->rrsz
- );
/* makes it into 0..totalweight inclusive; with 2^10 RRs,
* totalweight must be <= 2^26 so probability nonuniformity is
* no worse than 1 in 2^(31-26) ie 1 in 2^5, ie
/* makes it into 0..totalweight inclusive; with 2^10 RRs,
* totalweight must be <= 2^26 so probability nonuniformity is
* no worse than 1 in 2^(31-26) ie 1 in 2^5, ie
@@
-1174,10
+1166,6
@@
fprintf(stderr,"(postsort_srv totalweight %d randval %ld %ld..%ld<%ld)\n",
for (search=workbegin, runtotal=0;
(runtotal += (rr=(void*)search)->weight) < randval;
search += typei->rrsz);
for (search=workbegin, runtotal=0;
(runtotal += (rr=(void*)search)->weight) < randval;
search += typei->rrsz);
-fprintf(stderr,"(postsort_srv search %ld runtotal %d)\n",
- (unsigned long)(search - (char*)array) / typei->rrsz,
- runtotal
- );
assert(search < arrayend);
totalweight -= rr->weight;
if (search != workbegin) {
assert(search < arrayend);
totalweight -= rr->weight;
if (search != workbegin) {