From 12aff2e5b357d1b80b569bbf6cad23091686005d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 30 Mar 2016 18:12:03 +0200 Subject: [PATCH] rec: Extract ECS even w/o gettag. Wake worker when exiting. --- pdns/pdns_recursor.cc | 25 +++++++++++++++---------- pdns/remote_logger.cc | 1 + 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 704074ec4a..006e1c30f8 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1327,6 +1327,10 @@ string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fr string response; const struct dnsheader* dh = (struct dnsheader*)question.c_str(); unsigned int ctag=0; + bool needECS = false; +#ifdef HAVE_PROTOBUF + needECS = true; +#endif Netmask ednssubnet; try { uint32_t age; @@ -1341,27 +1345,28 @@ string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fr g_mtracer->clearAllocators(); */ #endif - if(t_pdl->get() && (*t_pdl)->d_gettag) { + if(needECS || (t_pdl->get() && (*t_pdl)->d_gettag)) { uint16_t qtype=0; try { DNSName qname; - getQNameAndSubnet(question, &qname, &qtype, &ednssubnet); - - try { - ctag=(*t_pdl)->gettag(fromaddr, ednssubnet, destaddr, qname, qtype); - } - catch(std::exception& e) { - if(g_logCommonErrors) - L<get() && (*t_pdl)->d_gettag) { + try { + ctag=(*t_pdl)->gettag(fromaddr, ednssubnet, destaddr, qname, qtype); + } + catch(std::exception& e) { + if(g_logCommonErrors) + L<getResponsePacket(ctag, question, g_now.tv_sec, &response, &age)) { diff --git a/pdns/remote_logger.cc b/pdns/remote_logger.cc index 4a237e98a3..a71018f64e 100644 --- a/pdns/remote_logger.cc +++ b/pdns/remote_logger.cc @@ -97,6 +97,7 @@ RemoteLogger::~RemoteLogger() d_exiting = true; if (d_socket >= 0) close(d_socket); + d_queueCond.notify_one(); d_thread.join(); } -- 2.47.2