Index: webrtc/p2p/base/relayport.cc |
diff --git a/webrtc/p2p/base/relayport.cc b/webrtc/p2p/base/relayport.cc |
index 8f7036cc5f7a116210420da36ade76436305e1e0..54951d31fdc55dc8f9ac78692c535f5179074cdc 100644 |
--- a/webrtc/p2p/base/relayport.cc |
+++ b/webrtc/p2p/base/relayport.cc |
@@ -255,7 +255,7 @@ void RelayPort::SetReady() { |
const ProtocolAddress * RelayPort::ServerAddress(size_t index) const { |
if (index < server_addr_.size()) |
return &server_addr_[index]; |
- return NULL; |
+ return nullptr; |
} |
bool RelayPort::HasMagicCookie(const char* data, size_t size) { |
@@ -449,17 +449,18 @@ void RelayConnection::SendAllocateRequest(RelayEntry* entry, int delay) { |
request_manager_->SendDelayed(new AllocateRequest(entry, this), delay); |
} |
-RelayEntry::RelayEntry(RelayPort* port, |
- const rtc::SocketAddress& ext_addr) |
- : port_(port), ext_addr_(ext_addr), |
- server_index_(0), connected_(false), locked_(false), |
- current_connection_(NULL) { |
-} |
+RelayEntry::RelayEntry(RelayPort* port, const rtc::SocketAddress& ext_addr) |
+ : port_(port), |
+ ext_addr_(ext_addr), |
+ server_index_(0), |
+ connected_(false), |
+ locked_(false), |
+ current_connection_(nullptr) {} |
RelayEntry::~RelayEntry() { |
// Remove all RelayConnections and dispose sockets. |
delete current_connection_; |
- current_connection_ = NULL; |
+ current_connection_ = nullptr; |
} |
void RelayEntry::Connect() { |
@@ -477,14 +478,14 @@ void RelayEntry::Connect() { |
// Remove any previous connection. |
if (current_connection_) { |
port()->thread()->Dispose(current_connection_); |
- current_connection_ = NULL; |
+ current_connection_ = nullptr; |
} |
// Try to set up our new socket. |
LOG(LS_INFO) << "Connecting to relay via " << ProtoToString(ra->proto) << |
" @ " << ra->address.ToSensitiveString(); |
- rtc::AsyncPacketSocket* socket = NULL; |
+ rtc::AsyncPacketSocket* socket = nullptr; |
if (ra->proto == PROTO_UDP) { |
// UDP sockets are simple. |
@@ -535,7 +536,7 @@ void RelayEntry::Connect() { |
} |
int RelayEntry::GetError() { |
- if (current_connection_ != NULL) { |
+ if (current_connection_ != nullptr) { |
return current_connection_->GetError(); |
} |
return 0; |
@@ -662,14 +663,14 @@ void RelayEntry::OnMessage(rtc::Message *pmsg) { |
port_->SignalSoftTimeout(ra); |
HandleConnectFailure(current_connection_->socket()); |
} else { |
- HandleConnectFailure(NULL); |
+ HandleConnectFailure(nullptr); |
} |
} |
void RelayEntry::OnSocketConnect(rtc::AsyncPacketSocket* socket) { |
LOG(INFO) << "relay tcp connected to " << |
socket->GetRemoteAddress().ToSensitiveString(); |
- if (current_connection_ != NULL) { |
+ if (current_connection_ != nullptr) { |
current_connection_->SendAllocateRequest(this, 0); |
} |
} |
@@ -688,7 +689,8 @@ void RelayEntry::OnReadPacket( |
// RTC_DCHECK(remote_addr == port_->server_addr()); |
// TODO: are we worried about this? |
- if (current_connection_ == NULL || socket != current_connection_->socket()) { |
+ if (current_connection_ == nullptr || |
+ socket != current_connection_->socket()) { |
// This packet comes from an unknown address. |
LOG(WARNING) << "Dropping packet: unknown address"; |
return; |