From: Chris Hofstaedtler Date: Mon, 30 Apr 2018 09:36:44 +0000 (+0200) Subject: Catch exceptions by-ref X-Git-Tag: dnsdist-1.3.1~120^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=819861fab32049297e4cd51e1b38480c13c85b91;p=thirdparty%2Fpdns.git Catch exceptions by-ref --- diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index 21453f1699..18a3378ad8 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -43,12 +43,12 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix) setArgPrefix(mode+suffix); d_db=0; d_logprefix="["+mode+"Backend"+suffix+"] "; - + try { d_dnssecQueries = mustDo("dnssec"); } - catch (ArgException e) + catch (const ArgException&) { d_dnssecQueries = false; } diff --git a/pdns/dnspcap.cc b/pdns/dnspcap.cc index a3d04fc9c1..4104b539a7 100644 --- a/pdns/dnspcap.cc +++ b/pdns/dnspcap.cc @@ -142,7 +142,7 @@ try } } } -catch(EofException) { +catch(const EofException&) { return false; } diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 72ecc51745..64188d3f90 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -574,7 +574,7 @@ static void updateDomainSettingsFromDocument(UeberBackend& B, const DomainInfo& bool api_rectify = boolFromJson(document, "api_rectify"); di.backend->setDomainMetadataOne(zonename, "API-RECTIFY", api_rectify ? "1" : "0"); } - catch (JsonException) {} + catch (const JsonException&) {} if (document["account"].is_string()) { di.backend->setAccount(zonename, document["account"].string_value()); @@ -588,7 +588,7 @@ static void updateDomainSettingsFromDocument(UeberBackend& B, const DomainInfo& dnssecDocVal = boolFromJson(document, "dnssec"); dnssecInJSON = true; } - catch (JsonException) {} + catch (const JsonException&) {} bool isDNSSECZone = dk.isSecuredZone(zonename); @@ -757,7 +757,7 @@ static void apiZoneMetadata(HttpRequest* req, HttpResponse *resp) { try { kind = stringFromJson(document, "kind"); - } catch (JsonException) { + } catch (const JsonException&) { throw ApiException("kind is not specified or not a string"); }