Show
Ignore:
Timestamp:
04/16/06 22:10:21 (7 years ago)
Author:
ahu
Message:

add automatic mplexer selection at runtime, still need to do compile time

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdns_recursor.cc

    r710 r713  
    11291129#endif 
    11301130 
     1131FDMultiplexer* getMultiplexer() 
     1132{ 
     1133  FDMultiplexer* ret; 
     1134  for(FDMultiplexer::FDMultiplexermap_t::const_iterator i = FDMultiplexer::getMultiplexerMap().begin(); 
     1135      i != FDMultiplexer::getMultiplexerMap().end(); ++i) { 
     1136    try { 
     1137      ret=i->second(); 
     1138      L<<Logger::Error<<"Enabled '"<<ret->getName()<<"' multiplexer"<<endl; 
     1139      return ret; 
     1140    } 
     1141    catch(...) 
     1142      {} 
     1143  } 
     1144  L<<Logger::Error<<"No working multiplexer found!"<<endl; 
     1145  exit(1); 
     1146} 
     1147 
    11311148int main(int argc, char **argv)  
    11321149{ 
     
    11901207 
    11911208    L.setName("pdns_recursor"); 
    1192     g_fdm=getMultiplexer(); 
     1209 
    11931210 
    11941211    L<<Logger::Warning<<"PowerDNS recursor "<<VERSION<<" (C) 2001-2006 PowerDNS.COM BV ("<<__DATE__", "__TIME__; 
     
    12031220      "according to the terms of the GPL version 2."<<endl; 
    12041221     
     1222    g_fdm=getMultiplexer(); 
    12051223 
    12061224    if(!::arg()["allow-from"].empty()) {