Index: webrtc/p2p/base/port.cc |
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc |
index d34b05f8e9973209d7c6d7eaf1925bac2564504b..1249ae46697b8732b0b60bd6bc85516ecefdb230 100644 |
--- a/webrtc/p2p/base/port.cc |
+++ b/webrtc/p2p/base/port.cc |
@@ -1006,6 +1006,11 @@ void Connection::Destroy() { |
port_->thread()->Post(this, MSG_DELETE); |
} |
+void Connection::FailAndDestroy() { |
+ set_state(Connection::STATE_FAILED); |
+ Destroy(); |
+} |
+ |
void Connection::PrintPingsSinceLastResponse(std::string* s, size_t max) { |
std::ostringstream oss; |
oss << std::boolalpha; |
@@ -1248,8 +1253,7 @@ void Connection::OnConnectionRequestErrorResponse(ConnectionRequest* request, |
// This is not a valid connection. |
LOG_J(LS_ERROR, this) << "Received STUN error response, code=" |
<< error_code << "; killing connection"; |
- set_state(STATE_FAILED); |
- Destroy(); |
+ FailAndDestroy(); |
} |
} |
@@ -1396,10 +1400,10 @@ void Connection::MaybeAddPrflxCandidate(ConnectionRequest* request, |
SignalStateChange(this); |
} |
-ProxyConnection::ProxyConnection(Port* port, size_t index, |
- const Candidate& candidate) |
- : Connection(port, index, candidate), error_(0) { |
-} |
+ProxyConnection::ProxyConnection(Port* port, |
+ size_t index, |
+ const Candidate& remote_candidate) |
+ : Connection(port, index, remote_candidate) {} |
int ProxyConnection::Send(const void* data, size_t size, |
const rtc::PacketOptions& options) { |