[asterisk-commits] russell: trunk r114527 - /trunk/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 22 10:46:02 CDT 2008


Author: russell
Date: Tue Apr 22 10:46:01 2008
New Revision: 114527

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114527
Log:
Correct action_ping() and action_events() with regards to Manager 1.1
documentation.  Also, fix a bug in xml_translate().

(closes issue #11649)
Reported by: ys
Patches:
      trunk_manager.c.diff uploaded by ys (license 281)

Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=114527&r1=114526&r2=114527
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Tue Apr 22 10:46:01 2008
@@ -1064,7 +1064,8 @@
 
 static int action_ping(struct mansession *s, const struct message *m)
 {
-	astman_send_response(s, m, "Success", "Ping: Pong\r\n");
+	astman_append(s, "Response: Success\r\n"
+			 "Ping: Pong\r\n");
 	return 0;
 }
 
@@ -1576,10 +1577,11 @@
 
 	res = set_eventmask(s, mask);
 	if (res > 0)
-		astman_send_response(s, m, "Success", "Events: On\r\n");
+		astman_append(s, "Response: Success\r\n"
+				 "Events: On\r\n");
 	else if (res == 0)
-		astman_send_response(s, m, "Success", "Events: Off\r\n");
-
+		astman_append(s, "Response: Success\r\n"
+				 "Events: Off\r\n");
 	return 0;
 }
 
@@ -3431,11 +3433,13 @@
 				ast_str_append(out, 0, xml ? "'" : "</td></tr>\n");
 				in_data = 0;
 			}
-			ast_str_append(out, 0, xml ? " /></response>\n" :
-				"<tr><td colspan=\"2\"><hr></td></tr>\r\n");
-			inobj = 0;
-			ao2_ref(vco, -1);
-			vco = NULL;
+			if (inobj) {
+				ast_str_append(out, 0, xml ? " /></response>\n" :
+					"<tr><td colspan=\"2\"><hr></td></tr>\r\n");
+				inobj = 0;
+				ao2_ref(vco, -1);
+				vco = NULL;
+			}
 			continue;
 		}
 




More information about the asterisk-commits mailing list