You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ja...@apache.org on 2016/03/02 17:48:13 UTC
[4/4] trafficserver git commit: Rename rr to is_rr
Rename rr to is_rr
Since rr is used widely to represent the HostDBRoundRobin structure, using rr as the name for "is rr" is quite confusing. This is a simple name change-- no change in behavior.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/84bd4fdc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/84bd4fdc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/84bd4fdc
Branch: refs/heads/master
Commit: 84bd4fdc84f1939ded150a59a7fb3957f204a3bc
Parents: 62bbecf
Author: Thomas Jackson <ja...@gmail.com>
Authored: Mon Feb 29 19:30:40 2016 -0800
Committer: Thomas Jackson <ja...@gmail.com>
Committed: Wed Mar 2 08:45:58 2016 -0800
----------------------------------------------------------------------
iocore/hostdb/HostDB.cc | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/84bd4fdc/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index eb5b541..e5ba0d7 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -1465,13 +1465,13 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
} else {
bool failed = !e;
- bool rr = false;
+ bool is_rr = false;
pending_action = NULL;
if (is_srv()) {
- rr = !failed && (e->srv_hosts.srv_host_count > 0);
+ is_rr = !failed && (e->srv_hosts.srv_host_count > 0);
} else if (!failed) {
- rr = 0 != e->ent.h_addr_list[1];
+ is_rr = 0 != e->ent.h_addr_list[1];
} else {
}
@@ -1495,7 +1495,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
int n = 0, nn = 0;
void *first = 0;
uint8_t af = e ? e->ent.h_addrtype : AF_UNSPEC; // address family
- if (rr) {
+ if (is_rr) {
if (is_srv() && !failed) {
n = e->srv_hosts.srv_host_count;
} else {
@@ -1514,7 +1514,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
}
if (!first) {
failed = true;
- rr = false;
+ is_rr = false;
}
}
} else if (!failed) {
@@ -1527,13 +1527,13 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
if (is_byname()) {
if (first)
ip_addr_set(tip, af, first);
- r = lookup_done(tip, md5.host_name, rr, ttl_seconds, failed ? 0 : &e->srv_hosts);
+ r = lookup_done(tip, md5.host_name, is_rr, ttl_seconds, failed ? 0 : &e->srv_hosts);
} else if (is_srv()) {
if (!failed)
tip._family = AF_INET; // force the tip valid, or else the srv will fail
r = lookup_done(tip, /* junk: FIXME: is the code in lookup_done() wrong to NEED this? */
md5.host_name, /* hostname */
- rr, /* is round robin, doesnt matter for SRV since we recheck getCount() inside lookup_done() */
+ is_rr, /* is round robin, doesnt matter for SRV since we recheck getCount() inside lookup_done() */
ttl_seconds, /* ttl in seconds */
failed ? 0 : &e->srv_hosts);
} else if (failed) {
@@ -1545,7 +1545,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
// @c lookup_done should always return a valid value so @a r should be null @c NULL.
ink_assert(r && r->app.allotment.application1 == 0 && r->app.allotment.application2 == 0);
- if (rr) {
+ if (is_rr) {
const int rrsize = HostDBRoundRobin::size(n, e->srv_hosts.srv_hosts_length);
HostDBRoundRobin *rr_data = (HostDBRoundRobin *)hostDB.alloc(&r->app.rr.offset, rrsize);
@@ -1652,7 +1652,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
r->round_robin_elt = 0;
}
}
- if (!failed && !rr && !is_srv())
+ if (!failed && !is_rr && !is_srv())
restore_info(r, old_r, old_info, old_rr_data);
ink_assert(!r || !r->round_robin || !r->reverse_dns);
ink_assert(failed || !r->round_robin || r->app.rr.offset);