]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pjsip_options.c: Fix race condition stopping periodic out of dialog OPTIONS request.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 24 Sep 2014 18:28:18 +0000 (18:28 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 24 Sep 2014 18:28:18 +0000 (18:28 +0000)
commitf0e43d7be226332c983898e3bf57514f7e09f2e4
tree36daea102a0b1bde4edb0559a3c708c2ff4b28b0
parentbe0ac348c669220132fcdb128c33e0305ea22b38
pjsip_options.c: Fix race condition stopping periodic out of dialog OPTIONS request.

The crash on the issues is a result of an invalid transport configuration
change when asterisk is restarted.  The attempt to send the qualify
request fails and we cleaned up.  However, the callback is also called
which results in a double unref of the objects involved.

* Put a wrapper around pjsip_endpt_send_request() to detect when the
passed in callback is called because of an error so callers can know to
not cleanup.

* Made send_request_cb() able to handle repeated challenges (Up to 10).

* Fix periodic endpoint qualify OPTIONS sched deletion race by avoiding
it.  The sched entry will no longer self stop and must be externally
stopped.

* Added REF_DEBUG description tags to struct sched_data in
pjsip_options.c.

* Fix some off-nominal ref leaks in schedule_qualify(),
qualify_and_schedule().

* Reordered pjsip_options.c module start/stop code to cleanup better on
error.

ASTERISK-24295 #close
Reported by: Rogger Padilla

Review: https://reviewboard.asterisk.org/r/3954/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@423866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_pjsip.c
res/res_pjsip/pjsip_options.c