From: Pieter Lexis Date: Fri, 16 Feb 2018 17:39:06 +0000 (+0100) Subject: ixfrdist: Make timeout for the whole AXFR X-Git-Tag: dnsdist-1.3.0~97^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=281ecb93b252cfaec95fcb11357dfa0db9c9ed3c;p=pdns ixfrdist: Make timeout for the whole AXFR --- diff --git a/pdns/ixfrdist.cc b/pdns/ixfrdist.cc index 98b84f5f7..a581392c2 100644 --- a/pdns/ixfrdist.cc +++ b/pdns/ixfrdist.cc @@ -240,7 +240,11 @@ void updateThread() { Resolver::res_t nop; vector chunk; records_t records; - while(axfr.getChunk(nop, &chunk, g_axfrTimeout)) { + time_t t_start = time(nullptr); + while(axfr.getChunk(nop, &chunk)) { + if (time(nullptr) - t_start > g_axfrTimeout) { + throw PDNSException("AXFR timeout exceeded"); + } for(auto& dr : chunk) { if(dr.d_type == QType::TSIG) continue; @@ -263,7 +267,7 @@ void updateThread() { if (g_verbose) { cerr<<"[INFO] Wrote zonedata for "<d_st.serial<<" to "<