diff options
author | honghaiz <honghaiz@webrtc.org> | 2016-01-05 09:06:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-05 17:06:20 +0000 |
commit | 6b9ab9204b9e0891cb0be2595a0d7ada92945cea (patch) | |
tree | 93b0b721d1f7071cf1eccfb7bd226c5cb62c89f2 /webrtc/p2p/base/turnport.h | |
parent | 37389b42b4f42c49583b5fa187611cdb6dcd67b4 (diff) | |
download | webrtc-6b9ab9204b9e0891cb0be2595a0d7ada92945cea.tar.gz |
Cease all future TURN requests when a TURN refresh request fails for a given TURN port.
This fixes an assert error in Turnport::OnSendStunPacket
BUG=webrtc:5388
Review URL: https://codereview.webrtc.org/1547373002
Cr-Commit-Position: refs/heads/master@{#11152}
Diffstat (limited to 'webrtc/p2p/base/turnport.h')
-rw-r--r-- | webrtc/p2p/base/turnport.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/webrtc/p2p/base/turnport.h b/webrtc/p2p/base/turnport.h index 4be9249c8f..a19f67632e 100644 --- a/webrtc/p2p/base/turnport.h +++ b/webrtc/p2p/base/turnport.h @@ -141,7 +141,8 @@ class TurnPort : public Port { sigslot::signal2<TurnPort*, int> SignalTurnRefreshResult; sigslot::signal3<TurnPort*, const rtc::SocketAddress&, int> SignalCreatePermissionResult; - void FlushRequests() { request_manager_.Flush(); } + void FlushRequests(int msg_type) { request_manager_.Flush(msg_type); } + bool HasRequests() { return !request_manager_.empty(); } void set_credentials(RelayCredentials& credentials) { credentials_ = credentials; } @@ -178,7 +179,8 @@ class TurnPort : public Port { enum { MSG_ALLOCATE_ERROR = MSG_FIRST_AVAILABLE, MSG_ALLOCATE_MISMATCH, - MSG_TRY_ALTERNATE_SERVER + MSG_TRY_ALTERNATE_SERVER, + MSG_REFRESH_ERROR }; typedef std::list<TurnEntry*> EntryList; @@ -199,7 +201,7 @@ class TurnPort : public Port { // Shuts down the turn port, usually because of some fatal errors. void Close(); - void OnTurnRefreshError() { Close(); } + void OnTurnRefreshError(); bool SetAlternateServer(const rtc::SocketAddress& address); void ResolveTurnAddress(const rtc::SocketAddress& address); void OnResolveResult(rtc::AsyncResolverInterface* resolver); |