[asterisk-dev] [Code Review]: Fix timeouts for ast_waitfordigit_full

David Lee reviewboard at asterisk.org
Wed Sep 12 15:01:35 CDT 2012



> On Sept. 12, 2012, 1:55 p.m., Mark Michelson wrote:
> > /branches/1.8/main/channel.c, lines 3583-3587
> > <https://reviewboard.asterisk.org/r/2109/diff/2/?file=31201#file31201line3583>
> >
> >     I was about to comment about how this has a slight semantic change in that passing a negative timeout to ast_waitfordigit_full() no longer would have the same effect as it previously did.
> >     
> >     Then I noticed a comment above ast_waitfordigit() in channel.c that says "/* XXX never to be called with ms = -1 */". I also noticed that ast_waitfor_digit[_full]() is never called with a negative timeout. So from all this, I'd say that the semantic change is a positive thing, and the XXX comment should be moved to the header file.

Nah; I don't think we're so lucky. There are a few places where the timeout may be read from configuration (like transferdigittimeout). It's less likely to be trouble to avoid the semantic change of a negative timeout, and remove the XXX comment you mentioned.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2109/#review7051
-----------------------------------------------------------


On Sept. 12, 2012, 1:04 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2109/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2012, 1:04 p.m.)
> 
> 
> Review request for Asterisk Developers and Mark Michelson.
> 
> 
> Summary
> -------
> 
> ast_waitfordigit_full would simply pass its timeout to ast_waitfor_nandfds, expecting it to decrement the timeout by however many milliseconds were waited. This is a problem if it consistently waits less than 1ms, the timeout will never be decremented, and we wait... FOREVER!
> 
> This patch instead has ast_waitfordigit_full manage the timeout itself.
> 
> 
> This addresses bug ASTERISK-20375.
>     https://issues.asterisk.org/jira/browse/ASTERISK-20375
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/channel.c 372975 
> 
> Diff: https://reviewboard.asterisk.org/r/2109/diff
> 
> 
> Testing
> -------
> 
> Mark confirmed that with the not-cleaned-up version of this patch, it fixed ASTERISK-20375. The cleanup consisted of changing variable names, adding comments, removing debug logging.
> 
> 
> Thanks,
> 
> David
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120912/3d55bc9b/attachment-0001.htm>


More information about the asterisk-dev mailing list