Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: webrtc/base/proxyserver.cc

Issue 1215713003: Ensuring that UDP TURN servers are always used as STUN servers. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing compiler warning from size_t->int cast Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/proxyserver.h ('k') | webrtc/base/socketadapters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 18 matching lines...) Expand all
29 server_socket_->SignalReadEvent.connect(this, &ProxyServer::OnAcceptEvent); 29 server_socket_->SignalReadEvent.connect(this, &ProxyServer::OnAcceptEvent);
30 } 30 }
31 31
32 ProxyServer::~ProxyServer() { 32 ProxyServer::~ProxyServer() {
33 for (BindingList::iterator it = bindings_.begin(); 33 for (BindingList::iterator it = bindings_.begin();
34 it != bindings_.end(); ++it) { 34 it != bindings_.end(); ++it) {
35 delete (*it); 35 delete (*it);
36 } 36 }
37 } 37 }
38 38
39 SocketAddress ProxyServer::GetServerAddress() {
40 return server_socket_->GetLocalAddress();
41 }
42
39 void ProxyServer::OnAcceptEvent(AsyncSocket* socket) { 43 void ProxyServer::OnAcceptEvent(AsyncSocket* socket) {
40 ASSERT(socket != NULL && socket == server_socket_.get()); 44 ASSERT(socket != NULL && socket == server_socket_.get());
41 AsyncSocket* int_socket = socket->Accept(NULL); 45 AsyncSocket* int_socket = socket->Accept(NULL);
42 AsyncProxyServerSocket* wrapped_socket = WrapSocket(int_socket); 46 AsyncProxyServerSocket* wrapped_socket = WrapSocket(int_socket);
43 AsyncSocket* ext_socket = ext_factory_->CreateAsyncSocket(ext_ip_.family(), 47 AsyncSocket* ext_socket = ext_factory_->CreateAsyncSocket(ext_ip_.family(),
44 SOCK_STREAM); 48 SOCK_STREAM);
45 if (ext_socket) { 49 if (ext_socket) {
46 ext_socket->Bind(ext_ip_); 50 ext_socket->Bind(ext_ip_);
47 bindings_.push_back(new ProxyBinding(wrapped_socket, ext_socket)); 51 bindings_.push_back(new ProxyBinding(wrapped_socket, ext_socket));
48 } else { 52 } else {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 145
142 void ProxyBinding::Destroy() { 146 void ProxyBinding::Destroy() {
143 SignalDestroyed(this); 147 SignalDestroyed(this);
144 } 148 }
145 149
146 AsyncProxyServerSocket* SocksProxyServer::WrapSocket(AsyncSocket* socket) { 150 AsyncProxyServerSocket* SocksProxyServer::WrapSocket(AsyncSocket* socket) {
147 return new AsyncSocksProxyServerSocket(socket); 151 return new AsyncSocksProxyServerSocket(socket);
148 } 152 }
149 153
150 } // namespace rtc 154 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/proxyserver.h ('k') | webrtc/base/socketadapters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698