Resolve a race condition in Stasis
authorKinsey Moore <kmoore@digium.com>
Wed, 20 Mar 2013 16:01:30 +0000 (16:01 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 20 Mar 2013 16:01:30 +0000 (16:01 +0000)
commit7ed0b80d94100626ccdd4ddb19207486bf59710a
tree14892acaae0ac2b3e42477759e8ed6c8dbfdc216
parent07d01e1c4185bf044f3ebb8bf49caf386c331351
Resolve a race condition in Stasis

Because of the way that topics were handled when publishing, it was
possible to dispatch a message to a subscription after that
subscription had been unsubscribed such that the dispatched message
arrived at the callback after the callback had received its final
message. In callbacks that cleaned up user data, this would often cause
a segfault. This has been resolved by locking the topic during the
entirety of dispatch. To prevent long publishing and topic locking
times, forwarding subscriptions have been made to be standard
subscriptions instead of mailboxless subscriptions which were
dispatched at publishing time.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/stasis.c