| 1056 | }; |
| 1057 | |
| 1058 | const char *acl_xml2_update(ACL_XML2 *xml, const char *data) |
| 1059 | { |
| 1060 | const char *myname = "acl_xml2_update"; |
| 1061 | |
| 1062 | if (data == NULL) |
| 1063 | return ""; |
| 1064 | else if (*data == 0) |
| 1065 | return data; |
| 1066 | |
| 1067 | if (!(xml->flag & ACL_XML2_FLAG_MULTI_ROOT) && xml->root_cnt > 0) |
| 1068 | return data; |
| 1069 | |
| 1070 | /* XML ������״̬��ѭ���������� */ |
| 1071 | |
| 1072 | while (*data) { |
| 1073 | if (xml->curr_node == NULL) { |
| 1074 | if (!(xml->flag & ACL_XML2_FLAG_MULTI_ROOT) |
| 1075 | && xml->root_cnt > 0) |
| 1076 | { |
| 1077 | break; |
| 1078 | } |
| 1079 | |
| 1080 | SKIP_SPACE(data); |
| 1081 | if (*data == 0) |
| 1082 | break; |
| 1083 | |
| 1084 | xml->curr_node = acl_xml2_node_alloc(xml); |
| 1085 | acl_xml2_node_add_child(xml->root, xml->curr_node); |
| 1086 | xml->curr_node->depth = xml->root->depth + 1; |
| 1087 | if (xml->curr_node->depth > xml->depth) |
| 1088 | xml->depth = xml->curr_node->depth; |
| 1089 | } |
| 1090 | |
| 1091 | data = status_tab[xml->curr_node->status].callback(xml, data); |
| 1092 | |
| 1093 | if (NO_SPACE(xml)) { |
| 1094 | acl_msg_warn("%s(%d), %s: space not enougth!", |
| 1095 | __FILE__, __LINE__, myname); |
| 1096 | break; |
| 1097 | } |
| 1098 | } |
| 1099 | |
| 1100 | return data; |
| 1101 | } |
no test coverage detected
searching dependent graphs…