File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,10 @@ void DnsStreamHandler::start()
6767 } catch (const std::exception &e) {
6868 throw ConfigException (" DnsStreamHandler: wrong value type for only_rcode filter. It should be an integer" );
6969 }
70- switch (want_code) {
71- case NoError:
72- case NXDomain:
73- case SrvFail:
74- case Refused:
70+ if (RCodeNames.find (want_code) != RCodeNames.end ()) {
7571 _f_enabled.set (Filters::OnlyRCode);
7672 _f_rcode = want_code;
77- break ;
78- default :
73+ } else {
7974 throw ConfigException (" DnsStreamHandler: only_rcode filter contained an invalid/unsupported rcode" );
8075 }
8176 _register_predicate_filter (Filters::OnlyRCode, " only_rcode" , std::to_string (_f_rcode));
Original file line number Diff line number Diff line change @@ -68,15 +68,10 @@ void DnsStreamHandler::start()
6868 } catch (const std::exception &e) {
6969 throw ConfigException (" DnsStreamHandler: wrong value type for only_rcode filter. It should be an integer" );
7070 }
71- switch (want_code) {
72- case NoError:
73- case NXDomain:
74- case SrvFail:
75- case Refused:
71+ if (RCodeNames.find (want_code) != RCodeNames.end ()) {
7672 _f_enabled.set (Filters::OnlyRCode);
7773 _f_rcode = want_code;
78- break ;
79- default :
74+ } else {
8075 throw ConfigException (" DnsStreamHandler: only_rcode filter contained an invalid/unsupported rcode" );
8176 }
8277 }
You can’t perform that action at this time.
0 commit comments