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

Unified Diff: webrtc/p2p/base/pseudotcp.cc

Issue 2640173002: Fix PseudoTcp to handle incoming packets with invalid SEQ field (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/pseudotcp.cc
diff --git a/webrtc/p2p/base/pseudotcp.cc b/webrtc/p2p/base/pseudotcp.cc
index ec302d3520423fa7ad1f95971feb950f6e37765d..db16c549da68699a3b1f5c96fbc696afc1e1aa1e 100644
--- a/webrtc/p2p/base/pseudotcp.cc
+++ b/webrtc/p2p/base/pseudotcp.cc
@@ -910,8 +910,13 @@ bool PseudoTcp::process(Segment& seg) {
} else {
uint32_t nOffset = seg.seq - m_rcv_nxt;
- rtc::StreamResult result = m_rbuf.WriteOffset(seg.data, seg.len,
- nOffset, NULL);
+ rtc::StreamResult result =
+ m_rbuf.WriteOffset(seg.data, seg.len, nOffset, NULL);
+ if (result == rtc::SR_BLOCK) {
+ // Ignore incoming packets outside of the receive window.
+ return false;
+ }
+
RTC_DCHECK(result == rtc::SR_SUCCESS);
RTC_UNUSED(result);
nisse-webrtc 2017/01/19 07:44:16 You can delete this RTC_UNUSED, it's a left over f
Sergey Ulanov 2017/01/19 18:06:32 Done.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698