Commit cb5a5f6e authored by Yoshitaka Aharen's avatar Yoshitaka Aharen
Browse files

[2157] corrected conditions for compound attributes

parent d5d8fa74
...@@ -203,35 +203,39 @@ Counters::incResponse(const MessageAttributes& msgattrs, ...@@ -203,35 +203,39 @@ Counters::incResponse(const MessageAttributes& msgattrs,
rcode_to_msgcounter[rcode] : MSG_RCODE_OTHER; rcode_to_msgcounter[rcode] : MSG_RCODE_OTHER;
server_msg_counter_.inc(rcode_type); server_msg_counter_.inc(rcode_type);
// compound attributes if (msgattrs.getRequestOpCode() == Opcode::QUERY_CODE) {
const unsigned int answer_rrs = // compound attributes
response.getRRCount(Message::SECTION_ANSWER); const unsigned int answer_rrs =
const bool is_aa_set = response.getHeaderFlag(Message::HEADERFLAG_AA); response.getRRCount(Message::SECTION_ANSWER);
const bool is_aa_set = response.getHeaderFlag(Message::HEADERFLAG_AA);
if (is_aa_set) {
// QryAuthAns if (is_aa_set) {
server_msg_counter_.inc(MSG_QRYAUTHANS); // QryAuthAns
} else { server_msg_counter_.inc(MSG_QRYAUTHANS);
// QryNoAuthAns
server_msg_counter_.inc(MSG_QRYNOAUTHANS);
}
if (rcode == Rcode::NOERROR_CODE) {
if (answer_rrs > 0) {
// QrySuccess
server_msg_counter_.inc(MSG_QRYSUCCESS);
} else { } else {
if (is_aa_set) { // QryNoAuthAns
// QryNxrrset server_msg_counter_.inc(MSG_QRYNOAUTHANS);
server_msg_counter_.inc(MSG_QRYNXRRSET); }
if (rcode == Rcode::NOERROR_CODE) {
if (answer_rrs > 0) {
// QrySuccess
server_msg_counter_.inc(MSG_QRYSUCCESS);
} else { } else {
// QryReferral if (is_aa_set) {
server_msg_counter_.inc(MSG_QRYREFERRAL); // QryNxrrset
server_msg_counter_.inc(MSG_QRYNXRRSET);
} else {
// QryReferral
server_msg_counter_.inc(MSG_QRYREFERRAL);
}
}
} else if (rcode == Rcode::REFUSED_CODE) {
if (!response.getHeaderFlag(Message::HEADERFLAG_RD)) {
// AuthRej
server_msg_counter_.inc(MSG_QRYREJECT);
} }
} }
} else if (rcode == Rcode::REFUSED_CODE) {
// AuthRej
server_msg_counter_.inc(MSG_QRYREJECT);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment