Remove Transport::Reset, which is never used, and only makes reading the code harder.
R=guoweis@webrtc.org Review URL: https://webrtc-codereview.appspot.com/43049004 Cr-Commit-Position: refs/heads/master@{#8965}
This commit is contained in:
parent
f9bbbdd158
commit
0666a9b28b
@ -121,21 +121,6 @@ void DtlsTransportChannelWrapper::Connect() {
|
|||||||
channel_->Connect();
|
channel_->Connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DtlsTransportChannelWrapper::Reset() {
|
|
||||||
channel_->Reset();
|
|
||||||
set_writable(false);
|
|
||||||
set_readable(false);
|
|
||||||
|
|
||||||
// Re-call SetupDtls()
|
|
||||||
if (!SetupDtls()) {
|
|
||||||
LOG_J(LS_ERROR, this) << "Error re-initializing DTLS";
|
|
||||||
dtls_state_ = STATE_CLOSED;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dtls_state_ = STATE_ACCEPTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DtlsTransportChannelWrapper::SetLocalIdentity(
|
bool DtlsTransportChannelWrapper::SetLocalIdentity(
|
||||||
rtc::SSLIdentity* identity) {
|
rtc::SSLIdentity* identity) {
|
||||||
if (dtls_state_ != STATE_NONE) {
|
if (dtls_state_ != STATE_NONE) {
|
||||||
|
@ -204,7 +204,6 @@ class DtlsTransportChannelWrapper : public TransportChannelImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void Connect();
|
virtual void Connect();
|
||||||
virtual void Reset();
|
|
||||||
|
|
||||||
virtual void OnSignalingReady() {
|
virtual void OnSignalingReady() {
|
||||||
channel_->OnSignalingReady();
|
channel_->OnSignalingReady();
|
||||||
|
@ -371,39 +371,6 @@ void P2PTransportChannel::Connect() {
|
|||||||
thread()->Post(this, MSG_PING);
|
thread()->Post(this, MSG_PING);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the socket, clear up any previous allocations and start over
|
|
||||||
void P2PTransportChannel::Reset() {
|
|
||||||
ASSERT(worker_thread_ == rtc::Thread::Current());
|
|
||||||
|
|
||||||
// Get rid of all the old allocators. This should clean up everything.
|
|
||||||
for (uint32 i = 0; i < allocator_sessions_.size(); ++i)
|
|
||||||
delete allocator_sessions_[i];
|
|
||||||
|
|
||||||
allocator_sessions_.clear();
|
|
||||||
ports_.clear();
|
|
||||||
connections_.clear();
|
|
||||||
best_connection_ = NULL;
|
|
||||||
|
|
||||||
// Forget about all of the candidates we got before.
|
|
||||||
remote_candidates_.clear();
|
|
||||||
|
|
||||||
// Revert to the initial state.
|
|
||||||
set_readable(false);
|
|
||||||
set_writable(false);
|
|
||||||
|
|
||||||
// Reinitialize the rest of our state.
|
|
||||||
waiting_for_signaling_ = false;
|
|
||||||
sort_dirty_ = false;
|
|
||||||
|
|
||||||
// If we allocated before, start a new one now.
|
|
||||||
if (transport_->connect_requested())
|
|
||||||
Allocate();
|
|
||||||
|
|
||||||
// Start pinging as the ports come in.
|
|
||||||
thread()->Clear(this);
|
|
||||||
thread()->Post(this, MSG_PING);
|
|
||||||
}
|
|
||||||
|
|
||||||
// A new port is available, attempt to make connections for it
|
// A new port is available, attempt to make connections for it
|
||||||
void P2PTransportChannel::OnPortReady(PortAllocatorSession *session,
|
void P2PTransportChannel::OnPortReady(PortAllocatorSession *session,
|
||||||
PortInterface* port) {
|
PortInterface* port) {
|
||||||
|
@ -71,7 +71,6 @@ class P2PTransportChannel : public TransportChannelImpl,
|
|||||||
const std::string& ice_pwd);
|
const std::string& ice_pwd);
|
||||||
virtual void SetRemoteIceMode(IceMode mode);
|
virtual void SetRemoteIceMode(IceMode mode);
|
||||||
virtual void Connect();
|
virtual void Connect();
|
||||||
virtual void Reset();
|
|
||||||
virtual void OnSignalingReady();
|
virtual void OnSignalingReady();
|
||||||
virtual void OnCandidate(const Candidate& candidate);
|
virtual void OnCandidate(const Candidate& candidate);
|
||||||
|
|
||||||
|
@ -380,25 +380,6 @@ void Transport::DestroyAllChannels_w() {
|
|||||||
DestroyTransportChannel(impls[i]);
|
DestroyTransportChannel(impls[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Transport::ResetChannels() {
|
|
||||||
ASSERT(signaling_thread()->IsCurrent());
|
|
||||||
worker_thread_->Invoke<void>(Bind(&Transport::ResetChannels_w, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Transport::ResetChannels_w() {
|
|
||||||
ASSERT(worker_thread()->IsCurrent());
|
|
||||||
|
|
||||||
// We are no longer attempting to connect
|
|
||||||
connect_requested_ = false;
|
|
||||||
|
|
||||||
// Clear out the old messages, they aren't relevant
|
|
||||||
rtc::CritScope cs(&crit_);
|
|
||||||
ready_candidates_.clear();
|
|
||||||
|
|
||||||
// Reset all of the channels
|
|
||||||
CallChannels_w(&TransportChannelImpl::Reset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Transport::OnSignalingReady() {
|
void Transport::OnSignalingReady() {
|
||||||
ASSERT(signaling_thread()->IsCurrent());
|
ASSERT(signaling_thread()->IsCurrent());
|
||||||
if (destroyed_) return;
|
if (destroyed_) return;
|
||||||
|
@ -55,9 +55,6 @@ class TransportChannelImpl : public TransportChannel {
|
|||||||
// Begins the process of attempting to make a connection to the other client.
|
// Begins the process of attempting to make a connection to the other client.
|
||||||
virtual void Connect() = 0;
|
virtual void Connect() = 0;
|
||||||
|
|
||||||
// Resets this channel back to the initial state (i.e., not connecting).
|
|
||||||
virtual void Reset() = 0;
|
|
||||||
|
|
||||||
// Allows an individual channel to request signaling and be notified when it
|
// Allows an individual channel to request signaling and be notified when it
|
||||||
// is ready. This is useful if the individual named channels have need to
|
// is ready. This is useful if the individual named channels have need to
|
||||||
// send their own transport-info stanzas.
|
// send their own transport-info stanzas.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user