From: Otto Date: Tue, 7 Dec 2021 16:46:30 +0000 (+0100) Subject: Reformat X-Git-Tag: auth-4.7.0-alpha1~111^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bf94def5db88b71ecca8135ad0efac619790649;p=thirdparty%2Fpdns.git Reformat --- diff --git a/pdns/lua-recursor4-ffi.hh b/pdns/lua-recursor4-ffi.hh index a607fd25bd..5b78b41627 100644 --- a/pdns/lua-recursor4-ffi.hh +++ b/pdns/lua-recursor4-ffi.hh @@ -56,7 +56,8 @@ extern "C" pdns_policy_kind_custom = 5 } pdns_policy_kind_t; - typedef struct pdns_ffi_record { + typedef struct pdns_ffi_record + { const char* name; const char* content; size_t content_len; @@ -117,7 +118,7 @@ extern "C" uint16_t pdns_postresolve_ffi_handle_get_rcode(const pdns_postresolve_ffi_handle_t* ref) __attribute__((visibility("default"))); pdns_policy_kind_t pdns_postresolve_ffi_handle_get_appliedpolicy_kind(const pdns_postresolve_ffi_handle_t* ref) __attribute__((visibility("default"))); void pdns_postresolve_ffi_handle_set_appliedpolicy_kind(pdns_postresolve_ffi_handle_t* ref, pdns_policy_kind_t kind) __attribute__((visibility("default"))); - bool pdns_postresolve_ffi_handle_get_record(pdns_postresolve_ffi_handle_t* ref, unsigned int i, pdns_ffi_record_t *record, bool raw) __attribute__((visibility("default"))); + bool pdns_postresolve_ffi_handle_get_record(pdns_postresolve_ffi_handle_t* ref, unsigned int i, pdns_ffi_record_t* record, bool raw) __attribute__((visibility("default"))); bool pdns_postresolve_ffi_handle_set_record(pdns_postresolve_ffi_handle_t* ref, unsigned int i, const char* content, size_t contentLen, bool raw) __attribute__((visibility("default"))); void pdns_postresolve_ffi_handle_clear_records(pdns_postresolve_ffi_handle_t* ref) __attribute__((visibility("default"))); bool pdns_postresolve_ffi_handle_add_record(pdns_postresolve_ffi_handle_t* ref, const char* name, uint16_t type, uint32_t ttl, const char* content, size_t contentLen, pdns_record_place_t place, bool raw) __attribute__((visibility("default"))); diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index 3d9ed867aa..95b7a45f34 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -1048,6 +1048,7 @@ public: const auto it = pool.insert(std::move(str)).first; return it; } + private: std::unordered_set pool; }; @@ -1089,7 +1090,7 @@ void pdns_postresolve_ffi_handle_set_appliedpolicy_kind(pdns_postresolve_ffi_han ref->handle.d_dq.appliedPolicy->d_kind = static_cast(kind); } -bool pdns_postresolve_ffi_handle_get_record(pdns_postresolve_ffi_handle_t* ref, unsigned int i, pdns_ffi_record_t *record, bool raw) +bool pdns_postresolve_ffi_handle_get_record(pdns_postresolve_ffi_handle_t* ref, unsigned int i, pdns_ffi_record_t* record, bool raw) { if (i >= ref->handle.d_dq.currentRecords->size()) { return false; @@ -1101,7 +1102,8 @@ bool pdns_postresolve_ffi_handle_get_record(pdns_postresolve_ffi_handle_t* ref, auto content = ref->insert(r.d_content->serialize(r.d_name, true)); record->content = content->data(); record->content_len = content->size(); - } else { + } + else { auto content = ref->insert(r.d_content->getZoneRepresentation()); record->content = content->data(); record->content_len = content->size(); @@ -1127,7 +1129,8 @@ bool pdns_postresolve_ffi_handle_set_record(pdns_postresolve_ffi_handle_t* ref, DNSRecord& r = ref->handle.d_dq.currentRecords->at(i); if (raw) { r.d_content = DNSRecordContent::deserialize(r.d_name, r.d_type, string(content, contentLen)); - } else { + } + else { r.d_content = DNSRecordContent::mastermake(r.d_type, QClass::IN, string(content, contentLen)); } @@ -1155,7 +1158,8 @@ bool pdns_postresolve_ffi_handle_add_record(pdns_postresolve_ffi_handle_t* ref, dr.d_place = DNSResourceRecord::Place(place); if (raw) { dr.d_content = DNSRecordContent::deserialize(dr.d_name, dr.d_type, string(content, contentLen)); - } else { + } + else { dr.d_content = DNSRecordContent::mastermake(type, QClass::IN, string(content, contentLen)); } ref->handle.d_dq.currentRecords->push_back(std::move(dr)); diff --git a/pdns/lua-recursor4.hh b/pdns/lua-recursor4.hh index 0bb256679e..c877725982 100644 --- a/pdns/lua-recursor4.hh +++ b/pdns/lua-recursor4.hh @@ -72,7 +72,6 @@ struct LuaContext::Pusher } }; - class RecursorLua4 : public BaseLua4 { public: @@ -224,10 +223,10 @@ public: typedef std::function(pdns_ffi_param_t*)> gettag_ffi_t; gettag_ffi_t d_gettag_ffi; - struct PostResolveFFIHandle { - PostResolveFFIHandle(DNSQuestion& dq) : d_dq(dq) + PostResolveFFIHandle(DNSQuestion& dq) : + d_dq(dq) { } DNSQuestion& d_dq;