commit | b140b9fd695c30f22016d2b6360caf6d1f525dff | [log] [tgz] |
---|---|---|
author | Taylor Brandstetter <deadbeef@webrtc.org> | Fri Oct 13 00:24:16 2017 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Oct 13 05:11:27 2017 |
tree | 152714c32be031d8b328f9780e49d82d017c4743 | |
parent | f0229767d1835d5857041298ede6348aa8423980 [diff] |
Keep count of libsrtp clients, and only deinitialize when it goes to 0. This is the same thing we're doing for usrsctp. Before this CL, the first SrtpSession to call SetKey would initialize libsrtp, and ChannelManager's destructor would deinitialize it. This works for an application that only uses one instance of ChannelManager simultaneously (or one instance of PeerConnectionFactory), but not one that uses multiple. Now, libsrtp is effectively reference-counted, with the first SrtpSession to take a reference initializing it, and the last to remove its reference deinitializing it. This issue was discovered recently due to a change that resulted in using srtp_update. Without using that method, the issue went unnoticed; maybe srtp_protect/srtp_unprotect don't require initialization? Bug: webrtc:8388 Change-Id: If1329360f0b469e454810e62e9b5acfbd4cba100 Reviewed-on: https://webrtc-review.googlesource.com/9000 Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Reviewed-by: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20262}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.