AXFRRetriever::AXFRRetriever(const ComboAddress& remote,
const DNSName& domain,
- const TSIGTriplet& tt,
+ const TSIGTriplet& tt,
const ComboAddress* laddr,
size_t maxReceivedBytes,
- uint16_t timeout)
- : d_buf(65536), d_tsigVerifier(tt, remote, d_trc), d_receivedBytes(0), d_maxReceivedBytes(maxReceivedBytes)
+ uint16_t timeout) :
+ d_buf(65536), d_tsigVerifier(tt, remote, d_trc), d_maxReceivedBytes(maxReceivedBytes)
{
ComboAddress local;
if (laddr != nullptr) {
TSIGRecordContent d_trc;
TSIGTCPVerifier d_tsigVerifier;
- size_t d_receivedBytes;
+ size_t d_receivedBytes{0};
size_t d_maxReceivedBytes;
};
class BindDomainInfo
{
public:
- BindDomainInfo() : hadFileDirective(false), d_dev(0), d_ino(0)
- {}
-
void clear()
{
name=DNSName();
vector<ComboAddress> primaries;
set<string> alsoNotify;
string type;
- bool hadFileDirective;
-
- dev_t d_dev;
- ino_t d_ino;
+ bool hadFileDirective{false};
+
+ dev_t d_dev{0};
+ ino_t d_ino{0};
bool operator<(const BindDomainInfo& b) const
{
class BindParser
{
public:
- BindParser() : d_dir("."), d_verbose(false)
- {
- yyin=0;
- extern int include_stack_ptr;
- include_stack_ptr=0;
-
- bind_directory=d_dir.c_str();
- }
+ BindParser()
+ {
+ yyin = 0;
+ extern int include_stack_ptr;
+ include_stack_ptr = 0;
+
+ bind_directory = d_dir.c_str();
+ }
~BindParser()
{
if(yyin) {
void addAlsoNotify(const string &host);
set<string> & getAlsoNotify() { return this->alsoNotify; }
private:
- string d_dir;
+ string d_dir{"."};
typedef map<DNSName,string> zonedomain_t;
set<string> alsoNotify;
vector<BindDomainInfo> d_zonedomains;
- bool d_verbose;
+ bool d_verbose{false};
};
class Comment
{
public:
- Comment() : modified_at(0), domain_id(0) {};
- ~Comment() = default;
-
// data
DNSName qname; //!< the name of the associated RRset, for example: www.powerdns.com
- time_t modified_at;
+ time_t modified_at{0};
string account; //!< account last updating this comment
string content; //!< The actual comment. Example: blah blah
- int domain_id;
+ int domain_id{0};
QType qtype; //!< qtype of the associated RRset, ie A, CNAME, MX etc
};
*/
-
-template <typename Container> GenericDNSPacketWriter<Container>::GenericDNSPacketWriter(Container& content, const DNSName& qname, uint16_t qtype, uint16_t qclass, uint8_t opcode)
- : d_content(content), d_qname(qname), d_canonic(false), d_lowerCase(false)
+template <typename Container>
+GenericDNSPacketWriter<Container>::GenericDNSPacketWriter(Container& content, const DNSName& qname, uint16_t qtype, uint16_t qclass, uint8_t opcode) :
+ d_content(content), d_qname(qname)
{
d_content.clear();
dnsheader dnsheader;
uint16_t d_truncatemarker; // end of header, for truncate
DNSResourceRecord::Place d_recordplace;
- bool d_canonic, d_lowerCase, d_compress{false};
+ bool d_canonic{false}, d_lowerCase{false}, d_compress{false};
};
using DNSPacketWriter = GenericDNSPacketWriter<std::vector<uint8_t>>;
template<typename Container, typename SenderReceiver> class Inflighter
{
public:
- Inflighter(Container& c, SenderReceiver& sr) : d_container(c), d_sr(sr), d_init(false)
+ Inflighter(Container& c, SenderReceiver& sr) :
+ d_container(c), d_sr(sr)
{
d_burst = 2;
d_maxInFlight = 5;
ttdwatch_t d_ttdWatch;
typename Container::iterator d_iter;
- bool d_init;
-
+ bool d_init{false};
+
uint64_t d_unexpectedResponse, d_timeouts;
};
}
Logger::Logger(string n, int facility) :
- name(std::move(n)), flags(LOG_PID | LOG_NDELAY), d_facility(facility), d_loglevel(Logger::None), consoleUrgency(Error), opened(false), d_disableSyslog(false)
+ name(std::move(n)), flags(LOG_PID | LOG_NDELAY), d_facility(facility)
{
open();
}
private:
struct PerThread
{
- PerThread() :
- d_urgency(Info)
- {}
string d_output;
- Urgency d_urgency;
+ Urgency d_urgency{Info};
};
PerThread& getPerThread();
void open();
string name;
int flags;
int d_facility;
- Urgency d_loglevel;
- Urgency consoleUrgency;
- bool opened;
- bool d_disableSyslog;
+ Urgency d_loglevel{Logger::None};
+ Urgency consoleUrgency{Error};
+ bool opened{false};
+ bool d_disableSyslog{false};
bool d_timestamps{true};
bool d_prefixed{false}; // this used to prefix the loglevel, but now causes formatting like structured logging
};
};
public:
- FDMultiplexer() :
- d_inrun(false)
- {}
virtual ~FDMultiplexer() = default;
// The maximum number of events processed in a single run, not the maximum of watched descriptors
callbackmap_t;
callbackmap_t d_readCallbacks, d_writeCallbacks;
- bool d_inrun;
+ bool d_inrun{false};
void accountingAddFD(callbackmap_t& cbmap, int fd, callbackfunc_t toDo, const funcparam_t& parameter, const struct timeval* ttd)
{
#include "base64.hh"
#include "namespaces.hh"
-RecordTextReader::RecordTextReader(string str, DNSName zone) : d_string(std::move(str)), d_zone(std::move(zone)), d_pos(0)
+RecordTextReader::RecordTextReader(string str, DNSName zone) :
+ d_string(std::move(str)), d_zone(std::move(zone))
{
/* remove whitespace */
if(!d_string.empty() && ( dns_isspace(*d_string.begin()) || dns_isspace(*d_string.rbegin()) ))
private:
string d_string;
DNSName d_zone;
- string::size_type d_pos;
+ string::size_type d_pos{0};
string::size_type d_end;
void skipSpaces();
};
return nullptr;
}
-ChunkedSigningPipe::ChunkedSigningPipe(DNSName signerName, bool mustSign, unsigned int workers, unsigned int maxChunkRecords)
- : d_signed(0), d_queued(0), d_outstanding(0), d_numworkers(workers), d_submitted(0), d_signer(std::move(signerName)),
- d_maxchunkrecords(maxChunkRecords), d_threads(d_numworkers), d_mustSign(mustSign), d_final(false)
+ChunkedSigningPipe::ChunkedSigningPipe(DNSName signerName, bool mustSign, unsigned int workers, unsigned int maxChunkRecords) :
+ d_signed(0), d_numworkers(workers), d_signer(std::move(signerName)), d_maxchunkrecords(maxChunkRecords), d_threads(d_numworkers), d_mustSign(mustSign)
{
d_rrsetToSign = make_unique<rrset_t>();
d_chunks.push_back(vector<DNSZoneRecord>()); // load an empty chunk
unsigned int getReady() const;
std::atomic<unsigned long> d_signed;
- unsigned int d_queued;
- unsigned int d_outstanding;
+ unsigned int d_queued{0};
+ unsigned int d_outstanding{0};
private:
void flushToSign();
void worker(int fd);
unsigned int d_numworkers;
- unsigned int d_submitted;
+ unsigned int d_submitted{0};
std::unique_ptr<rrset_t> d_rrsetToSign;
std::deque< std::vector<DNSZoneRecord> > d_chunks;
vector<std::thread> d_threads;
bool d_mustSign;
- bool d_final;
+ bool d_final{false};
};
d_listenaddress(std::move(listenaddress)),
d_port(port),
d_server(nullptr),
- d_maxbodysize(2*1024*1024),
- d_connectiontimeout(5)
+ d_maxbodysize(2 * 1024 * 1024)
+
{
YaHTTP::Router::Map("OPTIONS", "/<*url>", [](YaHTTP::Request *req, YaHTTP::Response *resp) {
// look for url in routes
std::unique_ptr<CredentialsHolder> d_webserverPassword{nullptr};
ssize_t d_maxbodysize; // in bytes
- int d_connectiontimeout; // in seconds
+ int d_connectiontimeout{5}; // in seconds
NetmaskGroup d_acl;
static const std::set<uint16_t> nonApexTypes = {QType::DS};
AuthWebServer::AuthWebServer() :
- d_start(time(nullptr)),
- d_min10(0),
- d_min5(0),
- d_min1(0)
+ d_start(time(nullptr))
+
{
if (arg().mustDo("webserver") || arg().mustDo("api")) {
d_ws = std::make_unique<WebServer>(arg()["webserver-address"], arg().asNum("webserver-port"));
void statThread(StatBag& stats);
time_t d_start;
- double d_min10, d_min5, d_min1;
+ double d_min10{0}, d_min5{0}, d_min1{0};
Ewma d_queries, d_cachehits, d_cachemisses;
Ewma d_qcachehits, d_qcachemisses;
unique_ptr<WebServer> d_ws{nullptr};
unsigned makeTTLFromZone(const std::string& str);
struct filestate {
- filestate(FILE* fp, string filename) : d_fp(fp), d_filename(std::move(filename)), d_lineno(0){}
+ filestate(FILE* fp, string filename) :
+ d_fp(fp), d_filename(std::move(filename)) {}
FILE *d_fp;
string d_filename;
- int d_lineno;
+ int d_lineno{0};
};
parts_t d_parts;