Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Side by Side Diff: webrtc/call/rtp_demuxer.cc

Issue 2941513002: Log an error in RtpDemuxer::FindSsrcAssociations() if kMaxProcessedSsrcs exceeded (Closed)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/call/rtp_demuxer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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
11 #include "webrtc/call/rtp_demuxer.h"
12
11 #include "webrtc/base/checks.h" 13 #include "webrtc/base/checks.h"
12 #include "webrtc/call/rtp_demuxer.h" 14 #include "webrtc/base/logging.h"
13 #include "webrtc/call/rtp_packet_sink_interface.h" 15 #include "webrtc/call/rtp_packet_sink_interface.h"
14 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" 16 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h"
15 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" 17 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
16 18
17 namespace webrtc { 19 namespace webrtc {
18 20
19 namespace { 21 namespace {
20 22
21 constexpr size_t kMaxProcessedSsrcs = 1000; // Prevent memory overuse. 23 constexpr size_t kMaxProcessedSsrcs = 1000; // Prevent memory overuse.
22 24
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 RecordSsrcToSinkAssociation(packet.Ssrc(), it->second); 113 RecordSsrcToSinkAssociation(packet.Ssrc(), it->second);
112 } 114 }
113 115
114 // To prevent memory-overuse attacks, forget this RSID. Future packets 116 // To prevent memory-overuse attacks, forget this RSID. Future packets
115 // with this RSID, but a different SSRC, will not spawn new associations. 117 // with this RSID, but a different SSRC, will not spawn new associations.
116 rsid_sinks_.erase(it_range.first, it_range.second); 118 rsid_sinks_.erase(it_range.first, it_range.second);
117 } 119 }
118 120
119 if (processed_ssrcs_.size() < kMaxProcessedSsrcs) { // Prevent memory overuse 121 if (processed_ssrcs_.size() < kMaxProcessedSsrcs) { // Prevent memory overuse
120 processed_ssrcs_.insert(packet.Ssrc()); // Avoid re-examining in-depth. 122 processed_ssrcs_.insert(packet.Ssrc()); // Avoid re-examining in-depth.
123 } else if (!logged_max_processed_ssrcs_exceeded_) {
124 LOG(LS_WARNING) << "More than " << kMaxProcessedSsrcs
125 << " different SSRCs seen.";
126 logged_max_processed_ssrcs_exceeded_ = true;
121 } 127 }
122 } 128 }
123 129
124 } // namespace webrtc 130 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/rtp_demuxer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698