- if (ptr->type == XML_ELEMENT_NODE &&
- !strcmp((const char *) ptr->name, "server"))
+ if (ptr->type != XML_ELEMENT_NODE)
+ continue;
+ struct _xmlAttr *attr = ptr->properties;
+ if (!strcmp((const char *) ptr->name, "listen"))
+ {
+ /*
+ <listen id="listenerid">tcp:@:9999</listen>
+ */
+ const char *id = 0;
+ const char *address =
+ nmem_dup_xml_content(gfs_nmem, ptr->children);
+ for ( ; attr; attr = attr->next)
+ if (!strcmp(attr->name, "id")
+ && attr->children && attr->children->type == XML_TEXT_NODE)
+ id = nmem_dup_xml_content(gfs_nmem, attr->children);
+ if (address)
+ {
+ *gfslp = gfs_listen_new(id, address);
+ gfslp = &(*gfslp)->next;
+ *gfslp = 0; /* make listener list consistent for search */
+ }
+ }
+ else if (!strcmp((const char *) ptr->name, "server"))