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

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

Issue 1415313004: Destroy a Connection if a CreatePermission request fails. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove "friend" relationship between TurnEntry and Connection. Created 5 years, 1 month 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 | « webrtc/p2p/base/turnport.h ('k') | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/turnport.cc
diff --git a/webrtc/p2p/base/turnport.cc b/webrtc/p2p/base/turnport.cc
index 3fdcac5f31b5804d094d8fe6e8a5891f7a8dd94e..fa2a0536786d81b5d450d5db128862331f8f1a8f 100644
--- a/webrtc/p2p/base/turnport.cc
+++ b/webrtc/p2p/base/turnport.cc
@@ -918,6 +918,17 @@ void TurnPort::OnConnectionDestroyed(Connection* conn) {
DestroyEntry(conn->remote_candidate().address());
}
+void TurnPort::OnCreatePermissionError(const rtc::SocketAddress address,
+ int code) {
+ Connection* c = GetConnection(address);
+ if (c) {
+ LOG_J(LS_ERROR, c) << "Received TURN CreatePermission error response, "
+ << "code=" << code << "; killing connection.";
+ c->set_state(Connection::STATE_FAILED);
+ c->Destroy();
pthatcher 2015/11/24 17:56:47 Why does this need to be friend class?
+ }
+}
+
TurnAllocateRequest::TurnAllocateRequest(TurnPort* port)
: StunRequest(new TurnMessage()),
port_(port) {
@@ -1347,6 +1358,7 @@ void TurnEntry::OnCreatePermissionError(StunMessage* response, int code) {
} else {
// Send signal with error code.
port_->SignalCreatePermissionResult(port_, ext_addr_, code);
+ port_->OnCreatePermissionError(ext_addr_, code);
}
}
« no previous file with comments | « webrtc/p2p/base/turnport.h ('k') | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698