[asterisk-commits] tilghman: trunk r129114 - /trunk/main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 8 15:17:09 CDT 2008


Author: tilghman
Date: Tue Jul  8 15:17:08 2008
New Revision: 129114

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129114
Log:
Reduce length of time that 'asterisk -rx' waits.
(closes issue #13001)
 Reported by: eliel
 Patches: 
       20080708__bug13001.diff.txt uploaded by Corydon76 (license 14)
       20080708__bug13001.diff.txt.fixed uploaded by eliel (license 64)
 Tested by: Corydon76, eliel

Modified:
    trunk/main/asterisk.c

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=129114&r1=129113&r2=129114
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Tue Jul  8 15:17:08 2008
@@ -1032,6 +1032,10 @@
 				break;
 			}
 			tmp[res] = 0;
+			if (strncmp(tmp, "cli quit after ", 15) == 0) {
+				ast_cli_command_multiple(con->fd, res - 15, tmp + 15);
+				break;
+			}
 			ast_cli_command_multiple(con->fd, res, tmp);
 		}
 		if (fds[1].revents) {
@@ -2439,8 +2443,12 @@
 	int num = 0;
 
 	read(ast_consock, buf, sizeof(buf));
-	if (data)
-		write(ast_consock, data, strlen(data) + 1);
+	if (data) {
+		char prefix[] = "cli quit after ";
+		char *tmp = alloca(strlen(data) + strlen(prefix) + 1);
+		sprintf(tmp, "%s%s", prefix, data);
+		write(ast_consock, tmp, strlen(tmp) + 1);
+	}
 	stringp = buf;
 	hostname = strsep(&stringp, "/");
 	cpid = strsep(&stringp, "/");




More information about the asterisk-commits mailing list