]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Merged revisions 375995 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Wed, 7 Nov 2012 17:25:46 +0000 (17:25 +0000)
committerAutomerge script <automerge@asterisk.org>
Wed, 7 Nov 2012 17:25:46 +0000 (17:25 +0000)
commita54fdc3e431f781bd7cbf4d5fb357891b10fc432
treee20493ecfeb04ba5a4219ca9fb2c8bfb62215167
parent00a9d4a50b70fbd7a94651d4e0a46358a87e95e7
Merged revisions 375995 via svnmerge from
file:///srv/subversion/repos/asterisk/branches/10

................
  r375995 | mmichelson | 2012-11-07 11:16:24 -0600 (Wed, 07 Nov 2012) | 41 lines

  Multiple revisions 375993-375994

  ........
    r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines

    Fix misuses of timeouts throughout the code.

    Prior to this change, a common method for determining if a timeout
    was reached was to call a function such as ast_waitfor_n() and inspect
    the out parameter that told how many milliseconds were left, then use
    that as the input to ast_waitfor_n() on the next go-around.

    The problem with this is that in some cases, submillisecond timeouts
    can occur, resulting in the out parameter not decreasing any. When this
    happens thousands of times, the result is that the timeout takes much
    longer than intended to be reached. As an example, I had a situation where
    a 3 second timeout took multiple days to finally end since most wakeups
    from ast_waitfor_n() were under a millisecond.

    This patch seeks to fix this pattern throughout the code. Now we log the
    time when an operation began and find the difference in wall clock time
    between now and when the event started. This means that sub-millisecond timeouts
    now cannot play havoc when trying to determine if something has timed out.

    Part of this fix also includes changing the function ast_waitfor() so that it
    is possible for it to return less than zero when a negative timeout is given
    to it. This makes it actually possible to detect errors in ast_waitfor() when
    there is no timeout.

    (closes issue ASTERISK-20414)
    reported by David M. Lee

    Review: https://reviewboard.asterisk.org/r/2135/
  ........
    r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines

    Remove some debugging that accidentally made it in the last commit.
  ........

  Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@376013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
18 files changed:
apps/app_dial.c
apps/app_jack.c
apps/app_meetme.c
apps/app_queue.c
apps/app_record.c
apps/app_waitforring.c
channels/chan_agent.c
channels/chan_dahdi.c
channels/chan_iax2.c
channels/sig_analog.c
channels/sig_pri.c
include/asterisk/channel.h
include/asterisk/time.h
main/channel.c
main/pbx.c
main/rtp_engine.c
main/utils.c
res/res_fax.c