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

Unified Diff: content/browser/renderer_host/p2p/socket_host_udp.cc

Issue 2843823002: Fix P2PSocketHostUdp to handle SetOptions() in error state (Closed)
Patch Set: dcheck Created 3 years, 8 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
Index: content/browser/renderer_host/p2p/socket_host_udp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_udp.cc b/content/browser/renderer_host/p2p/socket_host_udp.cc
index e4e744b7a461da46965ab147d9c7fd90dab47e65..375e5571dea14a9be82c132fc8953da029cce054 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -422,7 +422,11 @@ std::unique_ptr<P2PSocketHost> P2PSocketHostUdp::AcceptIncomingTcpConnection(
}
bool P2PSocketHostUdp::SetOption(P2PSocketOption option, int value) {
- DCHECK_EQ(STATE_OPEN, state_);
+ if (state_ != STATE_OPEN) {
+ DCHECK_EQ(state_, STATE_ERROR);
+ return false;
+ }
+
switch (option) {
case P2P_SOCKET_OPT_RCVBUF:
return socket_->SetReceiveBufferSize(value) == net::OK;

Powered by Google App Engine
This is Rietveld 408576698