Show
Ignore:
Timestamp:
03/27/06 00:16:00 (7 years ago)
Author:
ahu
Message:

trim some build dependencies, make rec_control/pdns_recursor grok /var/run as place for the controlsocket,
add tcp-questions in all the right places, add callback so 'rec_control quit' gets a response before the program quits

Files:
1 modified

Legend:

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

    r628 r631  
    3232#include "mtasker.hh" 
    3333#include <utility> 
    34 #include "dnspacket.hh" 
    3534#include "statbag.hh" 
    3635#include "arguments.hh" 
     
    4847#include "zoneparser-tng.hh" 
    4948#include "rec_channel.hh" 
     49#include "logger.hh" 
    5050 
    5151using namespace boost; 
     
    375375void makeControlChannelSocket() 
    376376{ 
    377   s_rcc.listen("pdns_recursor.controlsocket"); 
     377  s_rcc.listen(::arg()["socket-dir"]+"/pdns_recursor.controlsocket"); 
    378378} 
    379379 
     
    498498#endif 
    499499 
    500 uint64_t counter, qcounter; 
     500uint64_t counter; 
    501501bool statsWanted; 
    502502 
     
    519519void doStats(void) 
    520520{ 
    521   if(qcounter) { 
    522     L<<Logger::Error<<"stats: "<<qcounter<<" questions, "<<RC.size()<<" cache entries, "<<SyncRes::s_negcache.size()<<" negative entries, " 
     521  if(g_stats.qcounter) { 
     522    L<<Logger::Error<<"stats: "<<g_stats.qcounter<<" questions, "<<RC.size()<<" cache entries, "<<SyncRes::s_negcache.size()<<" negative entries, " 
    523523     <<(int)((RC.cacheHits*100.0)/(RC.cacheHits+RC.cacheMisses))<<"% cache hits"<<endl; 
    524524    L<<Logger::Error<<"stats: throttle map: "<<SyncRes::s_throttle.size()<<", ns speeds: " 
     
    834834        string msg=s_rcc.recv(&remote); 
    835835        RecursorControlParser rcp; 
    836         s_rcc.send(rcp.getAnswer(msg), &remote); 
     836        RecursorControlParser::func_t* command; 
     837        string answer=rcp.getAnswer(msg, &command); 
     838        s_rcc.send(answer, &remote); 
     839        command(); 
    837840      } 
    838841 
     
    877880              L<<Logger::Error<<"Ignoring answer on server socket!"<<endl; 
    878881            else { 
    879               ++qcounter; 
     882              ++g_stats.qcounter; 
    880883              dc->setSocket(*i); 
    881884              dc->d_tcp=false; 
     
    10271030                L<<Logger::Error<<"Ignoring answer on server socket!"<<endl; 
    10281031              else { 
    1029                 ++qcounter; 
     1032                ++g_stats.qcounter; 
     1033                ++g_stats.tcpqcounter; 
    10301034                MT->makeThread(startDoResolve, dc, "tcp"); 
    10311035              }