| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void set_enable_otu_nonce(bool enable) { | 64 void set_enable_otu_nonce(bool enable) { |
| 65 server_.set_enable_otu_nonce(enable); | 65 server_.set_enable_otu_nonce(enable); |
| 66 } | 66 } |
| 67 | 67 |
| 68 TurnServer* server() { return &server_; } | 68 TurnServer* server() { return &server_; } |
| 69 | 69 |
| 70 void set_redirect_hook(TurnRedirectInterface* redirect_hook) { | 70 void set_redirect_hook(TurnRedirectInterface* redirect_hook) { |
| 71 server_.set_redirect_hook(redirect_hook); | 71 server_.set_redirect_hook(redirect_hook); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void set_enable_permission_checks(bool enable) { |
| 75 server_.set_enable_permission_checks(enable); |
| 76 } |
| 77 |
| 74 void AddInternalSocket(const rtc::SocketAddress& int_addr, | 78 void AddInternalSocket(const rtc::SocketAddress& int_addr, |
| 75 ProtocolType proto) { | 79 ProtocolType proto) { |
| 76 rtc::Thread* thread = rtc::Thread::Current(); | 80 rtc::Thread* thread = rtc::Thread::Current(); |
| 77 if (proto == cricket::PROTO_UDP) { | 81 if (proto == cricket::PROTO_UDP) { |
| 78 server_.AddInternalSocket(rtc::AsyncUDPSocket::Create( | 82 server_.AddInternalSocket(rtc::AsyncUDPSocket::Create( |
| 79 thread->socketserver(), int_addr), proto); | 83 thread->socketserver(), int_addr), proto); |
| 80 } else if (proto == cricket::PROTO_TCP) { | 84 } else if (proto == cricket::PROTO_TCP) { |
| 81 // For TCP we need to create a server socket which can listen for incoming | 85 // For TCP we need to create a server socket which can listen for incoming |
| 82 // new connections. | 86 // new connections. |
| 83 rtc::AsyncSocket* socket = | 87 rtc::AsyncSocket* socket = |
| (...skipping 24 matching lines...) Expand all Loading... |
| 108 std::string* key) { | 112 std::string* key) { |
| 109 return ComputeStunCredentialHash(username, realm, username, key); | 113 return ComputeStunCredentialHash(username, realm, username, key); |
| 110 } | 114 } |
| 111 | 115 |
| 112 TurnServer server_; | 116 TurnServer server_; |
| 113 }; | 117 }; |
| 114 | 118 |
| 115 } // namespace cricket | 119 } // namespace cricket |
| 116 | 120 |
| 117 #endif // WEBRTC_P2P_BASE_TESTTURNSERVER_H_ | 121 #endif // WEBRTC_P2P_BASE_TESTTURNSERVER_H_ |
| OLD | NEW |