[Linux-cluster] ccsd patch to allow retrieval of child type + CDATA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is so we have a way to figure out child types as well as the CDATA
value.

Ex:

<cluster>
  <nodes>
    <node name="foo">stuff</node>
  </nodes>
</cluster>

Old behavior: 

[root@red lhh]# ccs_test connect
Connect successful.
 Connection descriptor = 0
[root@red lhh]# ccs_test get 0 /cluster/nodes/child::*[1]
Get successful.
 Value = <stuff>

New behavior:

[root@red lhh]# ccs_test connect
Connect successful.
 Connection descriptor = 0
[root@red lhh]# ccs_test get 0 /cluster/nodes/child::*[1]
Get successful.
 Value = <node=stuff>

? ccs_test/ccs_test
? daemon/ccsd
? make/defines.mk
Index: daemon/cnx_mgr.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/cnx_mgr.c,v
retrieving revision 1.7
diff -u -p -r1.7 cnx_mgr.c
--- daemon/cnx_mgr.c	4 Aug 2004 20:23:52 -0000	1.7
+++ daemon/cnx_mgr.c	6 Aug 2004 18:59:14 -0000
@@ -861,8 +861,10 @@ static int process_get(comm_header_t *ch
 
 	log_dbg("Query results:: %s\n", node->children->content);
 
-	if((node->type == XML_ATTRIBUTE_NODE) && strstr(query, "@*")){
-	  /* add on the trailing NULL and the '=' separator */
+	if(((node->type == XML_ATTRIBUTE_NODE) && strstr(query, "@*")) ||
+	    (node->type == XML_ELEMENT_NODE)){
+	  /* add on the trailing NULL and the '=' separator for a list of attrs
+	   or an element node + CDATA*/
 	  size = strlen(node->children->content)+strlen(node->name)+2;
 	  nnv= 1;
 	} else {

[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux