Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
3a838eb4
Commit
3a838eb4
authored
Sep 06, 2011
by
Michal 'vorner' Vaner
Browse files
[1176] Operator to combine FindOptions
parent
38c8e9a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/query.cc
View file @
3a838eb4
...
...
@@ -67,7 +67,7 @@ Query::findAddrs(ZoneFinder& zone, const Name& qname,
// Find A rrset
if
(
qname_
!=
qname
||
qtype_
!=
RRType
::
A
())
{
ZoneFinder
::
FindResult
a_result
=
zone
.
find
(
qname
,
RRType
::
A
(),
NULL
,
static_cast
<
ZoneFinder
::
FindOptions
>
(
options
|
dnssec_opt_
)
);
options
);
if
(
a_result
.
code
==
ZoneFinder
::
SUCCESS
)
{
response_
.
addRRset
(
Message
::
SECTION_ADDITIONAL
,
boost
::
const_pointer_cast
<
RRset
>
(
a_result
.
rrset
),
dnssec_
);
...
...
@@ -77,9 +77,7 @@ Query::findAddrs(ZoneFinder& zone, const Name& qname,
// Find AAAA rrset
if
(
qname_
!=
qname
||
qtype_
!=
RRType
::
AAAA
())
{
ZoneFinder
::
FindResult
aaaa_result
=
zone
.
find
(
qname
,
RRType
::
AAAA
(),
NULL
,
static_cast
<
ZoneFinder
::
FindOptions
>
(
options
|
dnssec_opt_
));
zone
.
find
(
qname
,
RRType
::
AAAA
(),
NULL
,
options
|
dnssec_opt_
);
if
(
aaaa_result
.
code
==
ZoneFinder
::
SUCCESS
)
{
response_
.
addRRset
(
Message
::
SECTION_ADDITIONAL
,
boost
::
const_pointer_cast
<
RRset
>
(
aaaa_result
.
rrset
),
...
...
src/lib/datasrc/zone.h
View file @
3a838eb4
...
...
@@ -205,6 +205,18 @@ public:
//@}
};
/// \brief Operator to combine FindOptions
///
/// We would need to manually static-cast the options if we put or
/// between them, which is undesired with bit-flag options. Therefore
/// we hide the cast here, which is the simplest solution and it still
/// provides reasonable level of type safety.
inline
ZoneFinder
::
FindOptions
operator
|
(
ZoneFinder
::
FindOptions
a
,
ZoneFinder
::
FindOptions
b
)
{
return
(
static_cast
<
ZoneFinder
::
FindOptions
>
(
a
|
b
));
}
/// \brief A pointer-like type pointing to a \c ZoneFinder object.
typedef
boost
::
shared_ptr
<
ZoneFinder
>
ZoneFinderPtr
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment