vector<DNSRecord> records;
size_t receivedBytes = 0;
int8_t ixfrInProgress = -2;
+ std::string reply;
for(;;) {
// IXFR end
if (maxReceivedBytes > 0 && (maxReceivedBytes - receivedBytes) < (size_t) len)
throw std::runtime_error("Reached the maximum number of received bytes in an IXFR delta for zone '"+zone.toLogString()+"' from master "+master.toStringWithPort());
- char reply[len];
- readn2(s.getHandle(), reply, len);
+ reply.resize(len);
+ readn2(s.getHandle(), &reply.at(0), len);
receivedBytes += len;
- MOADNSParser mdp(false, string(reply, len));
+ MOADNSParser mdp(false, reply);
if(mdp.d_header.rcode)
throw std::runtime_error("Got an error trying to IXFR zone '"+zone.toLogString()+"' from master '"+master.toStringWithPort()+"': "+RCode::to_s(mdp.d_header.rcode));
// cout<<"Got a response, rcode: "<<mdp.d_header.rcode<<", got "<<mdp.d_answers.size()<<" answers"<<endl;
if(!tt.algo.empty()) { // TSIG verify message
- tsigVerifier.check(std::string(reply, len), mdp);
+ tsigVerifier.check(reply, mdp);
}
for(auto& r: mdp.d_answers) {