Hi,

I've just been looking at hash.c, I am testing a fix for bug 232 
http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=232

I notice that in some cases, strncmp is used on the key, and in one 
case, memcmp is used instead.  What is the correct behaviour?

My proposed solution (which seems to work):
- there is a flags variable added to hash_t, and one of the flags is 
used to say ignore case
- all *cmp() calls go to a new function, hash_keycmp(), which checks the 
flags and uses strncasecmp if appropriate
- hashval() uses tolower() if the flag is set
- write_data_to_rrd() converts hostname to lowercase when generating a path
- get_context.php converts $hostname to lowercase

With this solution:
- all hostnames are lowercase in RRD paths
- if you retrieve the XML from the gmetad, you see the hostnames with 
the same capitalization that was received from a lower source in the 
hierarchy

Regards,

Daniel


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to