Changeset 1511
- Timestamp:
- 02/06/10 20:53:47 (3 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 3 modified
-
pdns_recursor.cc (modified) (7 diffs)
-
rec_channel_rec.cc (modified) (2 diffs)
-
syncres.hh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r1508 r1511 75 75 bool g_logCommonErrors; 76 76 __thread shared_ptr<PowerDNSLua>* t_pdl; 77 __thread RemoteKeeper* t_remotes; 77 78 78 79 RecursorControlChannel s_rcc; // only active in thread 0 … … 759 760 } 760 761 761 g_stats.addRemote(addr);762 t_remotes->addRemote(addr); 762 763 if(t_allowFrom && !t_allowFrom->match(&addr)) { 763 764 if(!g_quiet) … … 800 801 if((len=recvfrom(fd, data, sizeof(data), 0, (sockaddr *)&fromaddr, &addrlen)) >= 0) { 801 802 802 g_stats.addRemote(fromaddr);803 t_remotes->addRemote(fromaddr); 803 804 804 805 if(t_allowFrom && !t_allowFrom->match(&fromaddr)) { … … 1176 1177 } 1177 1178 1179 vector<ComboAddress>& operator+=(vector<ComboAddress>&a, const vector<ComboAddress>& b) 1180 { 1181 a.insert(a.end(), b.begin(), b.end()); 1182 return a; 1183 } 1184 1185 1186 1178 1187 template<class T> T broadcastAccFunction(const boost::function<T*()>& func, bool skipSelf) 1179 1188 { … … 1213 1222 template string broadcastAccFunction(const boost::function<string*()>& fun, bool skipSelf); // explicit instantiation 1214 1223 template uint64_t broadcastAccFunction(const boost::function<uint64_t*()>& fun, bool skipSelf); // explicit instantiation 1224 template vector<ComboAddress> broadcastAccFunction(const boost::function<vector<ComboAddress> *()>& fun, bool skipSelf); // explicit instantiation 1215 1225 1216 1226 void handleRCC(int fd, FDMultiplexer::funcparam_t& var) … … 1618 1628 g_initialDomainMap = parseAuthAndForwards(); 1619 1629 1620 // g_stats.remotes.resize(::arg().asNum("remotes-ringbuffer-entries")); XXX FIXME NEEDS TO BE REDONE FOR "MULTITHREADING" 1621 if(!g_stats.remotes.empty()) 1622 memset(&g_stats.remotes[0], 0, g_stats.remotes.size() * sizeof(RecursorStats::remotes_t::value_type)); 1630 1623 1631 g_logCommonErrors=::arg().mustDo("log-common-errors"); 1624 1632 … … 1703 1711 exit(99); 1704 1712 } 1713 1714 t_remotes = new RemoteKeeper(); 1715 t_remotes->remotes.resize(::arg().asNum("remotes-ringbuffer-entries") / g_numThreads); 1716 1717 if(!t_remotes->remotes.empty()) 1718 memset(&t_remotes->remotes[0], 0, t_remotes->remotes.size() * sizeof(RemoteKeeper::remotes_t::value_type)); 1719 1705 1720 1706 1721 MT=new MTasker<PacketID,string>(::arg().asNum("stack-size")); -
trunk/pdns/pdns/rec_channel_rec.cc
r1510 r1511 433 433 } 434 434 435 vector<ComboAddress>* pleaseGetRemotes() 436 { 437 return new vector<ComboAddress>(t_remotes->remotes); 438 } 435 439 436 440 string doTopRemotes() … … 438 442 typedef map<ComboAddress, int, ComboAddress::addressOnlyLessThan> counts_t; 439 443 counts_t counts; 440 444 445 vector<ComboAddress> remotes=broadcastAccFunction<vector<ComboAddress> >(pleaseGetRemotes); 446 441 447 unsigned int total=0; 442 for(Re cursorStats::remotes_t::const_iterator i=g_stats.remotes.begin(); i != g_stats.remotes.end(); ++i)448 for(RemoteKeeper::remotes_t::const_iterator i = remotes.begin(); i != remotes.end(); ++i) 443 449 if(i->sin4.sin_family) { 444 450 total++; -
trunk/pdns/pdns/syncres.hh
r1507 r1511 453 453 typedef MTasker<PacketID,string> MT_t; 454 454 extern __thread MT_t* MT; 455 455 456 456 457 struct RecursorStats … … 481 482 uint64_t packetCacheHits; 482 483 time_t startupTime; 483 484 }; 485 486 struct RemoteKeeper 487 { 484 488 typedef vector<ComboAddress> remotes_t; 485 489 remotes_t remotes; … … 493 497 } 494 498 }; 495 499 extern __thread RemoteKeeper* t_remotes; 496 500 string doQueueReloadLuaScript(vector<string>::const_iterator begin, vector<string>::const_iterator end); 497 501 void parseACLs();