We used to apply the default timeout of 10s to retrieve the chunk's
length even if we were passed a different one.
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");
// 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];
}
private:
void connect();
- int getLength();
+ int getLength(uint16_t timeout);
void timeoutReadn(uint16_t bytes, uint16_t timeoutsec=10);
shared_array<char> d_buf;