} while (retry >= 0);
}
-SMySQL::SMySQL(const string &database, const string &host, uint16_t port, const string &msocket, const string &user,
- const string &password, const string &group, bool setIsolation, unsigned int timeout, bool threadCleanup, bool clientSSL):
- d_database(database), d_host(host), d_msocket(msocket), d_user(user), d_password(password), d_group(group), d_timeout(timeout), d_port(port), d_setIsolation(setIsolation), d_threadCleanup(threadCleanup), d_clientSSL(clientSSL)
+SMySQL::SMySQL(string database, string host, uint16_t port, string msocket, string user,
+ string password, string group, bool setIsolation, unsigned int timeout, bool threadCleanup, bool clientSSL):
+ d_database(std::move(database)), d_host(std::move(host)), d_msocket(std::move(msocket)), d_user(std::move(user)), d_password(std::move(password)), d_group(std::move(group)), d_timeout(timeout), d_port(port), d_setIsolation(setIsolation), d_threadCleanup(threadCleanup), d_clientSSL(clientSSL)
{
connect();
}
class SMySQL : public SSql
{
public:
- SMySQL(const string &database, const string &host="", uint16_t port=0,
- const string &msocket="",const string &user="",
- const string &password="", const string &group="",
+ SMySQL(string database, string host="", uint16_t port=0,
+ string msocket="",string user="",
+ string password="", string group="",
bool setIsolation=false, unsigned int timeout=10,
bool threadCleanup=false, bool clientSSL=false);
if (size>0) conv.xfrBlobNoSpaces(d_otherData, size);
);
-MXRecordContent::MXRecordContent(uint16_t preference, const DNSName& mxname): d_preference(preference), d_mxname(mxname)
+MXRecordContent::MXRecordContent(uint16_t preference, DNSName mxname): d_preference(preference), d_mxname(std::move(mxname))
{
}
)
-SRVRecordContent::SRVRecordContent(uint16_t preference, uint16_t weight, uint16_t port, const DNSName& target)
-: d_weight(weight), d_port(port), d_target(target), d_preference(preference)
+SRVRecordContent::SRVRecordContent(uint16_t preference, uint16_t weight, uint16_t port, DNSName target)
+: d_weight(weight), d_port(port), d_target(std::move(target)), d_preference(preference)
{}
boilerplate_conv(SRV, QType::SRV,
conv.xfrName(d_target);
)
-SOARecordContent::SOARecordContent(const DNSName& mname, const DNSName& rname, const struct soatimes& st)
-: d_mname(mname), d_rname(rname), d_st(st)
+SOARecordContent::SOARecordContent(DNSName mname, DNSName rname, const struct soatimes& st)
+: d_mname(std::move(mname)), d_rname(std::move(rname)), d_st(st)
{
}
class MXRecordContent : public DNSRecordContent
{
public:
- MXRecordContent(uint16_t preference, const DNSName& mxname);
+ MXRecordContent(uint16_t preference, DNSName mxname);
includeboilerplate(MX)
class SRVRecordContent : public DNSRecordContent
{
public:
- SRVRecordContent(uint16_t preference, uint16_t weight, uint16_t port, const DNSName& target);
+ SRVRecordContent(uint16_t preference, uint16_t weight, uint16_t port, DNSName target);
includeboilerplate(SRV)
{
public:
includeboilerplate(SOA)
- SOARecordContent(const DNSName& mname, const DNSName& rname, const struct soatimes& st);
+ SOARecordContent(DNSName mname, DNSName rname, const struct soatimes& st);
DNSName d_mname;
DNSName d_rname;
open();
}
-Logger::Logger(const string &n, int facility) :
- name(n), flags(LOG_PID|LOG_NDELAY), d_facility(facility), d_loglevel(Logger::None),
+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)
{
open();
class Logger
{
public:
- Logger(const string &, int facility=LOG_DAEMON); //!< pass the identification you wish to appear in the log
+ Logger(string , int facility=LOG_DAEMON); //!< pass the identification you wish to appear in the log
//! The urgency of a log message
enum Urgency {All=32767,Alert=LOG_ALERT, Critical=LOG_CRIT, Error=LOG_ERR, Warning=LOG_WARNING,
#include "base64.hh"
#include "namespaces.hh"
-RecordTextReader::RecordTextReader(const string& str, const DNSName& zone) : d_string(str), d_zone(zone), d_pos(0)
+RecordTextReader::RecordTextReader(string str, DNSName zone) : d_string(std::move(str)), d_zone(std::move(zone)), d_pos(0)
{
/* remove whitespace */
if(!d_string.empty() && ( dns_isspace(*d_string.begin()) || dns_isspace(*d_string.rbegin()) ))
class RecordTextReader
{
public:
- RecordTextReader(const string& str, const DNSName& zone=DNSName(""));
+ RecordTextReader(string str, DNSName zone=DNSName(""));
void xfr64BitInt(uint64_t& val);
void xfr48BitInt(uint64_t& val);
void xfr32BitInt(uint32_t& val);
return nullptr;
}
-ChunkedSigningPipe::ChunkedSigningPipe(const DNSName& signerName, bool mustSign, unsigned int workers)
- : d_signed(0), d_queued(0), d_outstanding(0), d_numworkers(workers), d_submitted(0), d_signer(signerName),
+ChunkedSigningPipe::ChunkedSigningPipe(DNSName signerName, bool mustSign, unsigned int workers)
+ : d_signed(0), d_queued(0), d_outstanding(0), d_numworkers(workers), d_submitted(0), d_signer(std::move(signerName)),
d_maxchunkrecords(100), d_threads(d_numworkers), d_mustSign(mustSign), d_final(false)
{
d_rrsetToSign = make_unique<rrset_t>();
ChunkedSigningPipe(const ChunkedSigningPipe&) = delete;
void operator=(const ChunkedSigningPipe&) = delete;
- ChunkedSigningPipe(const DNSName& signerName, bool mustSign, unsigned int numWorkers=3);
+ ChunkedSigningPipe(DNSName signerName, bool mustSign, unsigned int numWorkers=3);
~ChunkedSigningPipe();
bool submit(const DNSZoneRecord& rr);
chunk_t getChunk(bool final=false);
}
}
-WebServer::WebServer(const string &listenaddress, int port) :
- d_listenaddress(listenaddress),
+WebServer::WebServer(string listenaddress, int port) :
+ d_listenaddress(std::move(listenaddress)),
d_port(port),
d_server(nullptr),
d_maxbodysize(2*1024*1024)
class WebServer : public boost::noncopyable
{
public:
- WebServer(const string &listenaddress, int port);
+ WebServer(string listenaddress, int port);
virtual ~WebServer() { };
void setApiKey(const string &apikey) {
static string g_INstr("IN");
-ZoneParserTNG::ZoneParserTNG(const string& fname, const DNSName& zname, const string& reldir, bool upgradeContent):
- d_reldir(reldir), d_zonename(zname), d_defaultttl(3600),
+ZoneParserTNG::ZoneParserTNG(const string& fname, DNSName zname, string reldir, bool upgradeContent):
+ d_reldir(std::move(reldir)), d_zonename(std::move(zname)), d_defaultttl(3600),
d_templatecounter(0), d_templatestop(0), d_templatestep(0),
d_havedollarttl(false), d_fromfile(true), d_upgradeContent(upgradeContent)
{
stackFile(fname);
}
-ZoneParserTNG::ZoneParserTNG(const vector<string>& zonedata, const DNSName& zname, bool upgradeContent):
- d_zonename(zname), d_zonedata(zonedata), d_defaultttl(3600),
+ZoneParserTNG::ZoneParserTNG(const vector<string>& zonedata, DNSName zname, bool upgradeContent):
+ d_zonename(std::move(zname)), d_zonedata(zonedata), d_defaultttl(3600),
d_templatecounter(0), d_templatestop(0), d_templatestep(0),
d_havedollarttl(false), d_fromfile(false), d_upgradeContent(upgradeContent)
{
class ZoneParserTNG
{
public:
- ZoneParserTNG(const string& fname, const DNSName& zname=g_rootdnsname, const string& reldir="", bool upgradeContent=false);
- ZoneParserTNG(const vector<string>& zonedata, const DNSName& zname, bool upgradeContent=false);
+ ZoneParserTNG(const string& fname, DNSName zname=g_rootdnsname, string reldir="", bool upgradeContent=false);
+ ZoneParserTNG(const vector<string>& zonedata, DNSName zname, bool upgradeContent=false);
~ZoneParserTNG();
bool get(DNSResourceRecord& rr, std::string* comment=0);