On Apr 24, 2013, at 4:44 PM, Igor Galić <i.ga...@brainsware.org> wrote:

> 
> 
> ----- Original Message -----
>> Updated Branches:
>>  refs/heads/master bb2fcaad3 -> 2915206c7
>> 
>> 
>> TS-1851: Remove HostDBInfo constructor so it becomes a POD
>> 
>> Somewhere down the line HostDBInfo grew enough constructor complexity
>> that it became a non-POD type. The allocation treats it like a POD
>> type, so we should make sure that the compiler agrees.
>> 
>> Rename HostDBRoundRobin::n to HostDBRoundRobin::rrcount. Remove
>> unused HostDBInfo::set_from
> [snip]
>> Commit: 2915206c73f08dcb9d262dfa0f19967f20eaabdf
>> Parents: bb2fcaa
> [snip]
>> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/iocore/hostdb/HostDB.cc
>> ----------------------------------------------------------------------
>> diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
>> index 52075d6..6221885 100644
>> --- a/iocore/hostdb/HostDB.cc
>> +++ b/iocore/hostdb/HostDB.cc
> [snip]
>> @@ -2233,7 +2237,7 @@ HostDBInfo::rr()
>> 
>>   HostDBRoundRobin *r = (HostDBRoundRobin *)
>>   hostDB.ptr(&app.rr.offset, hostDB.ptr_to_partition((char *)
>>   this));
>> 
>> -  if (r && (r->n > HOST_DB_MAX_ROUND_ROBIN_INFO || r->n <= 0 ||
>> r->good > HOST_DB_MAX_ROUND_ROBIN_INFO || r->good <= 0)) {
>> +  if (r && (r->rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || r->rrcount
>> <= 0 || r->good > HOST_DB_MAX_ROUND_ROBIN_INFO || r->good <= 0)) {
>>     ink_assert(!"bad round-robin");
>>     return NULL;
>>   }
>> @@ -2359,12 +2363,12 @@ struct ShowHostDB: public ShowCont
>>         HostDBRoundRobin *rr_data = r->rr();
>>         if (rr_data) {
>>           CHECK_SHOW(show("<table border=1>\n"));
>> -          CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n",
>> "Total", rr_data->n));
>> +          CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n",
>> "Total", rr_data->rrcount));
>>           CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n",
>>           "Good", rr_data->good));
>>           CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n",
>>           "Current", rr_data->current));
>>           CHECK_SHOW(show("</table>\n"));
>> 
>> -          for (int i = 0; i < rr_data->n; i++)
>> +          for (int i = 0; i < rr_data->rrcount; i++)
>>             showOne(&rr_data->info[i], true, event, e);
>>         }
>>       }
> 
> 
> This code (ugly mix of HTML and C) is surrounded by #ifdef NON_MODULAR
> which is #defined in lib/ts/ink_config.h if TS_HAS_STANDALONE_IOCORE 

Sure, but it would be weird to not rename the variable in some of the places.

J

Reply via email to