OLD | NEW |
---|---|
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 channels_.erase(iter); | 220 channels_.erase(iter); |
221 DestroyTransportChannel(channel); | 221 DestroyTransportChannel(channel); |
222 } | 222 } |
223 | 223 |
224 void Transport::ConnectChannels() { | 224 void Transport::ConnectChannels() { |
225 if (connect_requested_ || channels_.empty()) | 225 if (connect_requested_ || channels_.empty()) |
226 return; | 226 return; |
227 | 227 |
228 connect_requested_ = true; | 228 connect_requested_ = true; |
229 | 229 |
230 if (!local_description_) { | |
231 // TOOD(mallinath) : TransportDescription(TD) shouldn't be generated here. | |
232 // As Transport must know TD is offer or answer and cricket::Transport | |
233 // doesn't have the capability to decide it. This should be set by the | |
234 // Session. | |
235 // Session must generate local TD before remote candidates pushed when | |
236 // initiate request initiated by the remote. | |
237 LOG(LS_INFO) << "Transport::ConnectChannels: No local description has " | |
238 << "been set. Will generate one."; | |
239 TransportDescription desc(std::vector<std::string>(), | |
240 rtc::CreateRandomString(ICE_UFRAG_LENGTH), | |
241 rtc::CreateRandomString(ICE_PWD_LENGTH), | |
242 ICEMODE_FULL, CONNECTIONROLE_NONE, nullptr); | |
243 SetLocalTransportDescription(desc, CA_OFFER, nullptr); | |
244 } | |
245 | |
Taylor Brandstetter
2016/04/01 00:43:07
Can you add "RTC_DCHECK(local_description_ != null
| |
246 CallChannels(&TransportChannelImpl::Connect); | 230 CallChannels(&TransportChannelImpl::Connect); |
247 } | 231 } |
248 | 232 |
249 void Transport::MaybeStartGathering() { | 233 void Transport::MaybeStartGathering() { |
250 if (connect_requested_) { | 234 if (connect_requested_) { |
251 CallChannels(&TransportChannelImpl::MaybeStartGathering); | 235 CallChannels(&TransportChannelImpl::MaybeStartGathering); |
252 } | 236 } |
253 } | 237 } |
254 | 238 |
255 void Transport::DestroyAllChannels() { | 239 void Transport::DestroyAllChannels() { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 // negotiation happens. | 392 // negotiation happens. |
409 for (const auto& kv : channels_) { | 393 for (const auto& kv : channels_) { |
410 if (!ApplyNegotiatedTransportDescription(kv.second, error_desc)) { | 394 if (!ApplyNegotiatedTransportDescription(kv.second, error_desc)) { |
411 return false; | 395 return false; |
412 } | 396 } |
413 } | 397 } |
414 return true; | 398 return true; |
415 } | 399 } |
416 | 400 |
417 } // namespace cricket | 401 } // namespace cricket |
OLD | NEW |