Skip to content
Snippets Groups Projects
Commit 35e4cfce authored by Sébastien Blin's avatar Sébastien Blin
Browse files

multiplexed_socket: fix race condition on acceptation

Because some callbacks can take a long time (accepting a SIP channel
will starts to sync profiles, ask for new channel, etc), control packets
are handled in their own thread. However, if the peer accepts a request,
it can starts to use it and send data on it. When finished, it will close
the socket and both peer will remove the channel.
In some case, the channel can be removed before
MultiplexedSocket::Impl::onAccept, causing upper layers to handle a
bad channel. In this patch, we removes the channel only when upper layers
know that the channel is accepted and ready to use. Also, onAccept()
doesn't create wrong channels (which was a bug, where isInitiator() was
in the wrong state).

GitLab: #659
Change-Id: I4f45feacc2624ce0135ace09f7e0188b56fcf81f
parent 81d75c92
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment