On Mar 22, 2006, at 12:33 AM, Martin Knoblauch wrote:

Matt,

 after looking at your patch to process_xml.c I just want to ask
whether this is really the right solution.

no. :)

you're right.  please feel free to overwrite my half-baked patch.

-matt



 Before (-r1.45) the code tried to mark any protocol prior to "2.5" as
old (ignoring the case of 1.x :-). The code broke with the release of
3.0.


 Now (-r1.46) you are marking *any* 2.x code as old and any other code
(including 1.x :-) as new.

While I do not believe that 1.x is a real problem, your patch seems to
change the intended behaviour by marking any 2.x code as old. My patch
in the message below seems to cover the old behaviour (plus fixing the
1.x case :-).

 What do you think?

Cheers
Martin

diff -u -r1.45 -r1.46
--- process_xml.c       18 Nov 2004 20:14:31 -0000      1.45
+++ process_xml.c       21 Mar 2006 12:32:19 -0000      1.46
@@ -1,4 +1,4 @@
-/* $Id: process_xml.c,v 1.45 2004/11/18 20:14:31 massie Exp $ */
+/* $Id: process_xml.c,v 1.46 2006/03/21 12:32:19 massie Exp $ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -821,11 +821,16 @@
          if (xt->tag == VERSION_TAG)
             {
                   /* Process the version tag later */
-                  if(! strstr( attr[i+1], "2.5." ) )
-                     {
-                         debug_msg("[%s] is an OLD version",
xmldata->ds->name);
+                  if(! strncmp( attr[i+1], "2.", 2) )
+                  {
+                         debug_msg("[%s] is a 2.x data stream",
xmldata->ds->name);
                          xmldata->old = 1;
-                      }
+                  }
+                 else
+                 {
+                        debug_msg("[%s] is not a 2.x data stream",
xmldata->ds->name);
+                        xmldata->old = 0;
+                 }
              }
        }
    return 0;



--- [EMAIL PROTECTED] wrote:

Martin,

no doubt you will see matt's mail soon, we are doing a bit of mail
tag.
The version I already tested had an explicit assignment to 0, because
I was pretty sure it was needed.

I will happily go with whatever code version you and Matt prefer.
In the meantime I am patched and happy.

kind regards,
Richard

-----Original Message-----
From: Martin Knoblauch [mailto:[EMAIL PROTECTED]
Sent: 21 March 2006 12:49
To: Grevis, Richard: IT (LDN);
ganglia-developers@lists.sourceforge.net
Subject: RE: [Ganglia-developers] Possible bug in hosts up
calculation
when federating clusters.


Richard,

 OK. After another look at the code I am sure setting "old" to 0 does
not hurt. So, what about below one?

Martin

diff -u -r1.45 process_xml.c
--- process_xml.c       18 Nov 2004 20:14:31 -0000      1.45
+++ process_xml.c       21 Mar 2006 12:46:45 -0000
@@ -821,11 +821,15 @@
          if (xt->tag == VERSION_TAG)
             {
                   /* Process the version tag later */
-                  if(! strstr( attr[i+1], "2.5." ) )
+                  if( strcmp( attr[i+1], "2.5." ) < 0 )
                      {
                          debug_msg("[%s] is an OLD version",
xmldata->ds->name);
                          xmldata->old = 1;
                       }
+                  else
+                     {
+                         xmldata->old = 0;
+                      }
              }
        }
    return 0;



------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www:   http://www.knobisoft.de


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel? cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

--
[EMAIL PROTECTED]
  http://massie.us




Reply via email to