}
-
-
class DNSIDManager : public boost::noncopyable
{
public:
{
for(unsigned int i=0; i < 65536; ++i)
d_available.push_back(i);
-
}
uint16_t peakID()
> qids_t;
qids_t qids;
-
-
bool g_throttled;
unsigned int s_questions, s_origanswers, s_weanswers, s_wetimedout, s_perfect, s_mostly, s_origtimedout;
unsigned int s_weunmatched, s_origunmatched;
unsigned int s_wednserrors, s_origdnserrors, s_duplicates;
-
double DiffTime(const struct timeval& first, const struct timeval& second)
{
int seconds=second.tv_sec - first.tv_sec;
s_wednserrors++;
}
}
-
}
catch(std::exception& e)
{
- cerr<<"Receiver thread died: "<<e.what()<<endl;
+ cerr<<"Receiver function died: "<<e.what()<<endl;
exit(1);
}
catch(...)
{
- cerr<<"Receiver thread died with unknown exception"<<endl;
+ cerr<<"Receiver function died with unknown exception"<<endl;
exit(1);
}
}
}
-
void printStats(uint64_t origWaitingFor=0, uint64_t weWaitingFor=0)
{
format headerfmt ("%|9t|Questions - Pend. - Drop = Answers = (On time + Late) = (Err + Ok)\n");
format datafmt("%s%|9t|%d %|21t|%d %|29t|%d %|36t|%d %|47t|%d %|57t|%d %|66t|%d %|72t|%d\n");
-
cerr<<headerfmt;
cerr<<(datafmt % "Orig" % s_questions % origWaitingFor % s_orignever % s_origanswers % 0 % s_origtimedout % 0 % 0);
cerr<<(datafmt % "Refer." % s_questions % weWaitingFor % s_wenever % s_weanswers % 0 % s_wetimedout % 0 % 0);
cerr<<"original questions from IP addresses for which recursion was not available: "<<s_norecursionavailable<<endl;
cerr<<"Unmatched from us: "<<s_weunmatched<<", unmatched from original: "<<s_origunmatched << " ( - decoding err: "<<s_origunmatched-s_origdnserrors<<")"<<endl;
cerr<<"DNS decoding errors from us: "<<s_wednserrors<<", from original: "<<s_origdnserrors<<", exact duplicates from client: "<<s_duplicates<<endl<<endl;
-
}
void houseKeeping()
*/
printStats(origWaitingFor, weWaitingFor);
-
pruneQids();
-
}
unixDie("read from thread pipe returned wrong size or error");
}
- void *resp = tmsg->func();
+ void *resp=0;
+ try {
+ resp = tmsg->func();
+ }
+ catch(std::exception& e) {
+ L<<Logger::Error<<"PIPE function we executed created exception: "<<e.what()<<endl; // but what if they wanted an answer.. we send 0
+ }
+ catch(PDNSException& e) {
+ L<<Logger::Error<<"PIPE function we executed created PDNS exception: "<<e.reason<<endl; // but what if they wanted an answer.. we send 0
+ }
if(tmsg->wantAnswer)
if(write(g_pipes[t_id].writeFromThread, &resp, sizeof(resp)) != sizeof(resp))
unixDie("write to thread pipe returned wrong size or error");