Changeset 631 for trunk/pdns/pdns/rec_channel_rec.cc
- Timestamp:
- 03/27/06 00:16:00 (7 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/rec_channel_rec.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/rec_channel_rec.cc
r629 r631 12 12 #include <sys/stat.h> 13 13 #include <fcntl.h> 14 #include "logger.hh" 14 15 15 16 using namespace std; … … 99 100 optional<float> delay=g_stats.queryrate.get(now, 10); 100 101 if(delay) 101 return 1000000/(*delay);102 return (uint32_t)(1000000/(*delay)); 102 103 else 103 104 return 0; … … 106 107 RecursorControlParser::RecursorControlParser() 107 108 { 108 extern uint64_t qcounter;109 addGetStat(" questions", &qcounter);109 addGetStat("questions", &g_stats.qcounter); 110 addGetStat("tcp-questions", &g_stats.tcpqcounter); 110 111 111 112 addGetStat("cache-hits", &RC.cacheHits); … … 125 126 addGetStat("qa-latency", &g_stats.avgLatencyUsec); 126 127 127 addGetStat("all-questions", &qcounter);128 128 addGetStat("negcache-entries", boost::bind(&SyncRes::negcache_t::size, ref(SyncRes::s_negcache))); 129 129 addGetStat("throttle-entries", boost::bind(&SyncRes::throttle_t::size, ref(SyncRes::s_throttle))); … … 140 140 } 141 141 142 st ring RecursorControlParser::getAnswer(const string& question)142 static void doExit() 143 143 { 144 L<<Logger::Error<<"Exiting on user request"<<endl; 145 exit(1); 146 } 147 148 string RecursorControlParser::getAnswer(const string& question, RecursorControlParser::func_t** command) 149 { 150 *command=nop; 144 151 vector<string> words; 145 152 stringtok(words, question); 146 153 147 154 if(words.empty()) 148 return "invalid command ";155 return "invalid command\n"; 149 156 150 157 string cmd=toLower(words[0]); … … 154 161 return doGet(begin, end); 155 162 156 if(cmd=="quit") 157 exit(1); 163 if(cmd=="quit") { 164 *command=&doExit; 165 return "bye\n"; 166 } 158 167 159 168 if(cmd=="dump-cache")