From 281ecb93b252cfaec95fcb11357dfa0db9c9ed3c Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 16 Feb 2018 18:39:06 +0100 Subject: [PATCH] ixfrdist: Make timeout for the whole AXFR --- pdns/ixfrdist.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pdns/ixfrdist.cc b/pdns/ixfrdist.cc index 98b84f5f7b..a581392c29 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 "<