diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-16 21:38:05 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-16 21:38:05 +0000 |
commit | a2965486cc690ce768ae57639ba109d9f2688cfa (patch) | |
tree | b31239a2a801918cc2c136ea2b2dec743a54cc0b /apps/app_read.c | |
parent | 914f7e245d4f24cf1fe29f1380a145eb4cbafb0c (diff) |
Fixing app_read so that if a timeout of less than 1 ms is specified,
assume that 1 ms is desired.
(closes issue #11000, reported and patched by michael-fig, with a warning line added by me)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85965 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_read.c')
-rw-r--r-- | apps/app_read.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_read.c b/apps/app_read.c index f7203a6a7..4422cb157 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -127,8 +127,14 @@ static int read_exec(struct ast_channel *chan, void *data) tosec = atof(arglist.timeout); if (tosec <= 0) to = 0; - else + else { to = tosec * 1000.0; + if (to <= 0) { + /* Make sure we don't use the default timeout. */ + ast_log(LOG_WARNING, "Read timeout less than 1 ms, assuming 1 ms timeout\n"); + to = 1; + } + } } if (ast_strlen_zero(arglist.filename)) { |