Browse Source

Corrected BUG in PIDF document parsing - now it allows documents without
<basic> status element. Such documents will be parsed as if the basic status
is closed. (reported by Yi Zheng)

Vaclav Kubart 19 năm trước cách đây
mục cha
commit
7382e32988
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      lib/presence/pidf.c

+ 4 - 3
lib/presence/pidf.c

@@ -260,10 +260,11 @@ static int read_tuple(xmlNode *tuple, presence_tuple_info_t **dst, int ignore_ns
 	}
 	}
 	n = find_node(n, "basic", ns);
 	n = find_node(n, "basic", ns);
 	if (!n) {
 	if (!n) {
-		ERROR_LOG("basic status not found\n");
-		return -1;
+		ERROR_LOG("basic status not found - using \'closed\'\n");
+		/* return -1; */
+		s = "closed";
 	}
 	}
-	s = get_node_value(n);
+	else s = get_node_value(n);
 	if (!s) {
 	if (!s) {
 		ERROR_LOG("basic status without value\n");
 		ERROR_LOG("basic status without value\n");
 		return -1;
 		return -1;