OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 GetRtcpType(data, len, &type); | 720 GetRtcpType(data, len, &type); |
721 LOG(LS_ERROR) << "Failed to protect " << content_name_ | 721 LOG(LS_ERROR) << "Failed to protect " << content_name_ |
722 << " RTCP packet: size=" << len << ", type=" << type; | 722 << " RTCP packet: size=" << len << ", type=" << type; |
723 return false; | 723 return false; |
724 } | 724 } |
725 } | 725 } |
726 | 726 |
727 // Update the length of the packet now that we've added the auth tag. | 727 // Update the length of the packet now that we've added the auth tag. |
728 packet->SetSize(len); | 728 packet->SetSize(len); |
729 } else if (secure_required_) { | 729 } else if (secure_required_) { |
730 // This is a double check for something that supposedly can't happen. | 730 // The audio/video engines may attempt to send RTCP packets as soon as the |
731 LOG(LS_ERROR) << "Can't send outgoing " << PacketType(rtcp) | 731 // streams are created, so don't treat this as an error for RTCP. |
732 << " packet when SRTP is inactive and crypto is required"; | 732 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=6809 |
733 | 733 if (rtcp) { |
| 734 return false; |
| 735 } |
| 736 // However, there shouldn't be any RTP packets sent before SRTP is set up |
| 737 // (and SetSend(true) is called). |
| 738 LOG(LS_ERROR) << "Can't send outgoing RTP packet when SRTP is inactive" |
| 739 << " and crypto is required"; |
734 RTC_DCHECK(false); | 740 RTC_DCHECK(false); |
735 return false; | 741 return false; |
736 } | 742 } |
737 | 743 |
738 // Bon voyage. | 744 // Bon voyage. |
739 int flags = (secure() && secure_dtls()) ? PF_SRTP_BYPASS : PF_NORMAL; | 745 int flags = (secure() && secure_dtls()) ? PF_SRTP_BYPASS : PF_NORMAL; |
740 int ret = channel->SendPacket(packet->data<char>(), packet->size(), | 746 int ret = channel->SendPacket(packet->data<char>(), packet->size(), |
741 updated_options, flags); | 747 updated_options, flags); |
742 if (ret != static_cast<int>(packet->size())) { | 748 if (ret != static_cast<int>(packet->size())) { |
743 if (channel->GetError() == ENOTCONN) { | 749 if (channel->GetError() == ENOTCONN) { |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2457 } | 2463 } |
2458 | 2464 |
2459 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { | 2465 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { |
2460 rtc::TypedMessageData<uint32_t>* message = | 2466 rtc::TypedMessageData<uint32_t>* message = |
2461 new rtc::TypedMessageData<uint32_t>(sid); | 2467 new rtc::TypedMessageData<uint32_t>(sid); |
2462 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_STREAMCLOSEDREMOTELY, | 2468 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_STREAMCLOSEDREMOTELY, |
2463 message); | 2469 message); |
2464 } | 2470 } |
2465 | 2471 |
2466 } // namespace cricket | 2472 } // namespace cricket |
OLD | NEW |