diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-09 19:34:12 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-09 19:34:12 +0000 |
commit | dd630cc4504c31d0db63696bd1c0269343937fbb (patch) | |
tree | d73a890735712fd867d53536728d5607cb075db6 | |
parent | 5fbc774f67ee605583fe32b865712d10f03e7639 (diff) |
ensure CLI commands produce proper terminating output when used with manager interface (bug #4497)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5884 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | apps/app_queue.c | 8 | ||||
-rwxr-xr-x | channels/chan_iax2.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index c4f2de1f9..49662f3b5 100755 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3152,9 +3152,13 @@ static char *complete_queue(char *line, char *word, int pos, int state) static int manager_queues_show( struct mansession *s, struct message *m ) { char *a[] = { "show", "queues" }; - return queues_show(s->fd, 2, a); -} + ast_mutex_lock(&s->lock); + queues_show(s->fd, 2, a); + ast_cli(s->fd, "\r\n\r\n"); /* Properly terminate Manager output */ + ast_mutex_unlock(&s->lock); + return RESULT_SUCCESS; +} /* Dump queue status */ static int manager_queues_status( struct mansession *s, struct message *m ) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 8c1b9c816..d8e3df5d6 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -4222,8 +4222,10 @@ static int manager_iax2_show_peers( struct mansession *s, struct message *m ) { char *a[] = { "iax2", "show", "users" }; int ret; + ast_mutex_lock(&s->lock); ret = iax2_show_peers( s->fd, 3, a ); - ast_cli( s->fd, "\r\n" ); + ast_cli( s->fd, "\r\n\r\n" ); + ast_mutex_unlock(&s->lock); return ret; } /* /JDG */ |