diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-28 13:08:56 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-28 13:08:56 +0000 |
commit | a522c1ce0f884efc647e74b86bd4fd6d9b6db1a8 (patch) | |
tree | 3d1d06b0be450f591deca383bece26503150c967 /main | |
parent | 062fee49d60e85b8107a36134612566f7a9b0e58 (diff) |
do not return 500 Internal error if the AMI command provides
no output.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48083 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/manager.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/manager.c b/main/manager.c index 6207bb239..1c4d2c19e 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2767,10 +2767,11 @@ static char *generic_http_callback(enum output_format format, char *buf; off_t len = lseek(s->fd, 0, SEEK_END); /* how many chars available */ - if (len > 0 && (buf = ast_calloc(1, len+1))) { + /* always return something even if len == 0 */ + if ((buf = ast_calloc(1, len+1))) { if (!s->outputstr) s->outputstr = ast_calloc(1, sizeof(*s->outputstr)); - if (s->outputstr) { + if (len > 0 && s->outputstr) { lseek(s->fd, 0, SEEK_SET); read(s->fd, buf, len); if (0) |