return {};
});
- luaCtx.registerFunction<std::string (DNSQuestion::*)() const>("getProtocol", [](const DNSQuestion& dnsQuestion) {
+ luaCtx.registerFunction<std::string (DNSQuestion::*)() const>("getProtocol", [](const DNSQuestion& dnsQuestion) -> std::string {
+ // coverity[auto_causes_copy]
return dnsQuestion.getProtocol().toPrettyString();
});
}
return tagIt->second;
});
- luaCtx.registerFunction<QTag (DNSQuestion::*)(void) const>("getTagArray", [](const DNSQuestion& dnsQuestion) {
+ luaCtx.registerFunction<QTag (DNSQuestion::*)(void) const>("getTagArray", [](const DNSQuestion& dnsQuestion) -> QTag {
if (!dnsQuestion.ids.qTag) {
QTag empty;
return empty;
return std::string();
});
- luaCtx.registerFunction<LuaAssociativeTable<std::string> (DNSQuestion::*)(void) const>("getHTTPHeaders", [](const DNSQuestion& dnsQuestion) {
+ luaCtx.registerFunction<LuaAssociativeTable<std::string> (DNSQuestion::*)(void) const>("getHTTPHeaders", [](const DNSQuestion& dnsQuestion) -> LuaAssociativeTable<std::string> {
#if defined(HAVE_DNS_OVER_HTTPS)
if (dnsQuestion.ids.du) {
// coverity[auto_causes_copy]
/* OK, so we the metric exists (otherwise we would have returned an Error) but the label doesn't yet */
{
+ // too bad Coverity claims to understand C++ yet does not understand RAII
+ // coverity[double_lock]
auto writeLockedMap = metricMap.write_lock();
auto labelsMapIt = writeLockedMap->find(name);
if (labelsMapIt == writeLockedMap->end()) {