Changeset 2625
- Timestamp:
- 06/07/12 10:44:31 (12 months ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/misc.cc
r2307 r2625 560 560 } 561 561 562 static bool comparePlace(DNSResourceRecord a, DNSResourceRecord b) 563 { 564 return (a.d_place < b.d_place); 565 } 566 567 // make sure rrs is sorted in d_place order to avoid surprises later 568 // then shuffle the parts that desire shuffling 569 void orderAndShuffle(vector<DNSResourceRecord>& rrs) 570 { 571 std::stable_sort(rrs.begin(), rrs.end(), comparePlace); 572 shuffle(rrs); 573 } 562 574 563 575 void normalizeTV(struct timeval& tv) -
trunk/pdns/pdns/misc.hh
r2246 r2625 289 289 string makeHexDump(const string& str); 290 290 void shuffle(vector<DNSResourceRecord>& rrs); 291 void orderAndShuffle(vector<DNSResourceRecord>& rrs); 291 292 292 293 void normalizeTV(struct timeval& tv); -
trunk/pdns/pdns/pdns_recursor.cc
r2544 r2625 555 555 556 556 if(ret.size()) { 557 shuffle(ret);557 orderAndShuffle(ret); 558 558 559 559 for(vector<DNSResourceRecord>::const_iterator i=ret.begin(); i!=ret.end(); ++i) {