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

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

Issue 1020293002: Check if the connected socket id already exists for P2PSocketDispatcherHost::OnAcceptIncomingTcpCon… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: content/browser/renderer_host/p2p/socket_dispatcher_host.cc
diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
index 913adf7710f14474db3d1c9a578f3a1c91b5a549..3a2a5ea64a7a23c75ff03431ccbaf56aa0e4bc06 100644
--- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
+++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
@@ -262,9 +262,15 @@ void P2PSocketDispatcherHost::OnAcceptIncomingTcpConnection(
P2PSocketHost* socket = LookupSocket(listen_socket_id);
if (!socket) {
LOG(ERROR) << "Received P2PHostMsg_AcceptIncomingTcpConnection "
- "for invalid socket_id.";
+ "for invalid listen_socket_id.";
return;
}
+ if (LookupSocket(connected_socket_id) != NULL) {
+ LOG(ERROR) << "Received P2PHostMsg_AcceptIncomingTcpConnection "
+ "for duplicated connected_socket_id.";
+ return;
+ }
+
P2PSocketHost* accepted_connection =
socket->AcceptIncomingTcpConnection(remote_address, connected_socket_id);
if (accepted_connection) {
« 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