OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004--2011 Google Inc. | 3 * Copyright 2004--2011 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 for (StunIt stun_it = stun.begin(); stun_it != stun.end(); ++stun_it) { | 64 for (StunIt stun_it = stun.begin(); stun_it != stun.end(); ++stun_it) { |
65 stun_hosts.insert(stun_it->server); | 65 stun_hosts.insert(stun_it->server); |
66 } | 66 } |
67 | 67 |
68 scoped_ptr<cricket::BasicPortAllocator> allocator( | 68 scoped_ptr<cricket::BasicPortAllocator> allocator( |
69 new cricket::BasicPortAllocator( | 69 new cricket::BasicPortAllocator( |
70 network_manager_.get(), socket_factory_.get(), stun_hosts)); | 70 network_manager_.get(), socket_factory_.get(), stun_hosts)); |
71 | 71 |
72 for (size_t i = 0; i < turn.size(); ++i) { | 72 for (size_t i = 0; i < turn.size(); ++i) { |
73 cricket::RelayCredentials credentials(turn[i].username, turn[i].password); | 73 cricket::RelayCredentials credentials(turn[i].username, turn[i].password); |
74 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); | 74 cricket::RelayServerConfig turn_server(cricket::RELAY_TURN); |
75 cricket::ProtocolType protocol; | 75 cricket::ProtocolType protocol; |
76 if (cricket::StringToProto(turn[i].transport_type.c_str(), &protocol)) { | 76 if (cricket::StringToProto(turn[i].transport_type.c_str(), &protocol)) { |
77 relay_server.ports.push_back(cricket::ProtocolAddress( | 77 turn_server.ports.push_back( |
78 turn[i].server, protocol, turn[i].secure)); | 78 cricket::ProtocolAddress(turn[i].server, protocol, turn[i].secure)); |
79 relay_server.credentials = credentials; | 79 turn_server.credentials = credentials; |
80 // First in the list gets highest priority. | 80 // First in the list gets highest priority. |
81 relay_server.priority = static_cast<int>(turn.size() - i - 1); | 81 turn_server.priority = static_cast<int>(turn.size() - i - 1); |
82 allocator->AddRelay(relay_server); | 82 allocator->AddTurnServer(turn_server); |
83 } else { | 83 } else { |
84 LOG(LS_WARNING) << "Ignoring TURN server " << turn[i].server << ". " | 84 LOG(LS_WARNING) << "Ignoring TURN server " << turn[i].server << ". " |
85 << "Reason= Incorrect " << turn[i].transport_type | 85 << "Reason= Incorrect " << turn[i].transport_type |
86 << " transport parameter."; | 86 << " transport parameter."; |
87 } | 87 } |
88 } | 88 } |
89 return allocator.release(); | 89 return allocator.release(); |
90 } | 90 } |
91 | 91 |
92 } // namespace webrtc | 92 } // namespace webrtc |
OLD | NEW |