#include "pdns/namespaces.hh"
#include <algorithm>
-
class SPgSQLStatement: public SSqlStatement
{
public:
paramValues = NULL;
paramLengths = NULL;
d_do_commit = false;
+ d_paridx = 0;
+ d_residx = 0;
+ d_resnum = 0;
+ d_fnum = 0;
+ d_cur_set = 0;
}
SSqlStatement* bind(const string& name, bool value) { return bind(name, string(value ? "t" : "f")); }
static int maxNSEC3Iterations=::arg().asNum("max-nsec3-iterations");
if(ns3p) {
- NSEC3PARAMRecordContent* tmp=dynamic_cast<NSEC3PARAMRecordContent*>(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value));
- *ns3p = *tmp;
- delete tmp;
+ *ns3p = NSEC3PARAMRecordContent(value);
if (ns3p->d_iterations > maxNSEC3Iterations) {
ns3p->d_iterations = maxNSEC3Iterations;
L<<Logger::Error<<"Number of NSEC3 iterations for zone '"<<zname<<"' is above 'max-nsec3-iterations'. Value adjusted to: "<<maxNSEC3Iterations<<endl;
d_rawpacket=orig.d_rawpacket;
d_tsig_algo=orig.d_tsig_algo;
d=orig.d;
+
+ d_isQuery = orig.d_isQuery;
}
void DNSPacket::setRcode(int v)
continue;
}
- char lenBuf[2];
- int recvRes;
+ unsigned char lenBuf[2];
+ ssize_t recvRes;
recvRes = recv(sock, &lenBuf, sizeof(lenBuf), 0);
- if (recvRes < 0) {
+ if (recvRes < 0 || static_cast<size_t>(recvRes) < sizeof(lenBuf)) {
L<<Logger::Error<<msgPrefix<<"Could not receive data (length) from master at "<<remote.toStringWithPort()<<", error:"<<stringerror()<<endl;
try {
closesocket(sock);
}
continue;
}
- int packetLen = lenBuf[0]*256+lenBuf[1];
-
+ size_t packetLen = lenBuf[0]*256+lenBuf[1];
char buf[packetLen];
recvRes = recv(sock, &buf, packetLen, 0);
}
try {
- MOADNSParser mdp(false, buf, recvRes);
+ MOADNSParser mdp(false, buf, static_cast<unsigned int>(recvRes));
L<<Logger::Info<<msgPrefix<<"Forward update message to "<<remote.toStringWithPort()<<", result was RCode "<<mdp.d_header.rcode<<endl;
return mdp.d_header.rcode;
}