Index: webrtc/pc/channel.cc |
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc |
index f3c3211fdfbf2d5f5f42ba52f4dd2f26c81d72da..5bbaf5fbaadde14c5901cd4ca0c37e2be74f8e3e 100644 |
--- a/webrtc/pc/channel.cc |
+++ b/webrtc/pc/channel.cc |
@@ -164,7 +164,8 @@ BaseChannel::BaseChannel(rtc::Thread* worker_thread, |
MediaChannel* media_channel, |
TransportController* transport_controller, |
const std::string& content_name, |
- bool rtcp) |
+ bool rtcp, |
+ bool srtp_required) |
: worker_thread_(worker_thread), |
network_thread_(network_thread), |
@@ -172,6 +173,7 @@ BaseChannel::BaseChannel(rtc::Thread* worker_thread, |
transport_controller_(transport_controller), |
rtcp_enabled_(rtcp), |
+ srtp_required_(srtp_required), |
media_channel_(media_channel), |
selected_candidate_pair_(nullptr) { |
RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); |
@@ -726,7 +728,7 @@ bool BaseChannel::SendPacket(bool rtcp, |
// Update the length of the packet now that we've added the auth tag. |
packet->SetSize(len); |
- } else if (secure_required_) { |
+ } else if (srtp_required_) { |
// This is a double check for something that supposedly can't happen. |
LOG(LS_ERROR) << "Can't send outgoing " << PacketType(rtcp) |
<< " packet when SRTP is inactive and crypto is required"; |
@@ -809,7 +811,7 @@ void BaseChannel::HandlePacket(bool rtcp, rtc::CopyOnWriteBuffer* packet, |
} |
packet->SetSize(len); |
- } else if (secure_required_) { |
+ } else if (srtp_required_) { |
// Our session description indicates that SRTP is required, but we got a |
// packet before our SRTP filter is active. This means either that |
// a) we got SRTP packets before we received the SDES keys, in which case |
@@ -1085,7 +1087,7 @@ bool BaseChannel::SetRtpTransportParameters( |
return true; |
} |
- // Cache secure_required_ for belt and suspenders check on SendPacket |
+ // Cache srtp_required_ for belt and suspenders check on SendPacket |
return network_thread_->Invoke<bool>( |
RTC_FROM_HERE, Bind(&BaseChannel::SetRtpTransportParameters_n, this, |
content, action, src, error_desc)); |
@@ -1098,10 +1100,6 @@ bool BaseChannel::SetRtpTransportParameters_n( |
std::string* error_desc) { |
RTC_DCHECK(network_thread_->IsCurrent()); |
- if (src == CS_LOCAL) { |
- set_secure_required(content->crypto_required() != CT_NONE); |
- } |
- |
if (!SetSrtp_n(content->cryptos(), action, src, error_desc)) { |
return false; |
} |
@@ -1470,13 +1468,15 @@ VoiceChannel::VoiceChannel(rtc::Thread* worker_thread, |
VoiceMediaChannel* media_channel, |
TransportController* transport_controller, |
const std::string& content_name, |
- bool rtcp) |
+ bool rtcp, |
+ bool srtp_required) |
: BaseChannel(worker_thread, |
network_thread, |
media_channel, |
transport_controller, |
content_name, |
- rtcp), |
+ rtcp, |
+ srtp_required), |
media_engine_(media_engine), |
received_media_(false) {} |
@@ -1883,13 +1883,15 @@ VideoChannel::VideoChannel(rtc::Thread* worker_thread, |
VideoMediaChannel* media_channel, |
TransportController* transport_controller, |
const std::string& content_name, |
- bool rtcp) |
+ bool rtcp, |
+ bool srtp_required) |
: BaseChannel(worker_thread, |
network_thread, |
media_channel, |
transport_controller, |
content_name, |
- rtcp) {} |
+ rtcp, |
+ srtp_required) {} |
bool VideoChannel::Init_w(const std::string* bundle_transport_name) { |
if (!BaseChannel::Init_w(bundle_transport_name)) { |
@@ -2144,13 +2146,15 @@ DataChannel::DataChannel(rtc::Thread* worker_thread, |
DataMediaChannel* media_channel, |
TransportController* transport_controller, |
const std::string& content_name, |
- bool rtcp) |
+ bool rtcp, |
+ bool srtp_required) |
: BaseChannel(worker_thread, |
network_thread, |
media_channel, |
transport_controller, |
content_name, |
- rtcp), |
+ rtcp, |
+ srtp_required), |
data_channel_type_(cricket::DCT_NONE), |
ready_to_send_data_(false) {} |