diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-08 20:17:08 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-08 20:17:08 +0000 |
commit | 9f7cc21fc8971a3f0d1bcfaf42a941419a2701b2 (patch) | |
tree | d6a5e258249913e1a3d4e08968206cb5db09ded6 /main/asterisk.c | |
parent | 697a11d4393ac6d84552033775c778ab22d33336 (diff) |
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
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@129114 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r-- | main/asterisk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 9bbeebd25..739bf3dea 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1032,6 +1032,10 @@ static void *netconsole(void *vconsole) 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 @@ static void ast_remotecontrol(char * data) 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, "/"); |