Permalink
Browse files

avoid superfluous backend recycling

  • Loading branch information...
1 parent bee1d90 commit c849701f7be442b21db69366d00cd92b64d660cd @Habbie Habbie committed Aug 24, 2015
Showing with 20 additions and 2 deletions.
  1. +20 −2 pdns/distributor.hh
View
@@ -259,7 +259,16 @@ template<class Answer, class Question, class Backend>void *MultiThreadDistributo
AnswerData<Answer> AD;
AD.A=a;
- QD.callback(AD);
+ try {
+ QD.callback(AD);
+ }
+ catch(std::exception& e)
+ {
+ L<<Logger::Error<<"Error in callback (while sending reply): "<<e.what()<<endl;
+ }
+ catch(...) {
+ L<<Logger::Error<<"Unknown callback (sending reply) error"<<endl;
+ }
}
delete b;
@@ -299,7 +308,16 @@ template<class Answer, class Question, class Backend>int SingleThreadDistributor
}
AnswerData<Answer> AD;
AD.A=a;
- callback(AD);
+ try {
+ callback(AD);
+ }
+ catch(std::exception& e)
+ {
+ L<<Logger::Error<<"Error in callback (while sending reply): "<<e.what()<<endl;
+ }
+ catch(...) {
+ L<<Logger::Error<<"Unknown callback (sending reply) error"<<endl;
+ }
return 0;
}

0 comments on commit c849701

Please sign in to comment.