From: Remi Gacogne Date: Sun, 25 Feb 2018 15:41:36 +0000 (+0100) Subject: ixfrdist: Also respect the AXFR timeout for the chunk's length X-Git-Tag: dnsdist-1.3.0~80^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b726c12720f31a6cdd94a06ccb3a427a96f19669;p=pdns ixfrdist: Also respect the AXFR timeout for the chunk's length We used to apply the default timeout of 10s to retrieve the chunk's length even if we were passed a different one. --- diff --git a/pdns/resolver.cc b/pdns/resolver.cc index bdc3ebf68..b839f1fd9 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -442,7 +442,7 @@ int AXFRRetriever::getChunk(Resolver::res_t &res, vector* records, ui return false; // d_sock is connected and is about to spit out a packet - int len=getLength(); + int len=getLength(timeout); if(len<0) throw ResolverException("EOF trying to read axfr chunk from remote TCP client"); @@ -557,9 +557,9 @@ void AXFRRetriever::connect() // d_sock now connected } -int AXFRRetriever::getLength() +int AXFRRetriever::getLength(uint16_t timeout) { - timeoutReadn(2); + timeoutReadn(2, timeout); return (unsigned char)d_buf[0]*256+(unsigned char)d_buf[1]; } diff --git a/pdns/resolver.hh b/pdns/resolver.hh index 9246994cb..419aa032e 100644 --- a/pdns/resolver.hh +++ b/pdns/resolver.hh @@ -91,7 +91,7 @@ class AXFRRetriever : public boost::noncopyable private: void connect(); - int getLength(); + int getLength(uint16_t timeout); void timeoutReadn(uint16_t bytes, uint16_t timeoutsec=10); shared_array d_buf;