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 358 matching lines...) Loading... |
369 server_address_.proto == PROTO_TLS) { | 369 server_address_.proto == PROTO_TLS) { |
370 socket_->SignalConnect.connect(this, &TurnPort::OnSocketConnect); | 370 socket_->SignalConnect.connect(this, &TurnPort::OnSocketConnect); |
371 socket_->SignalClose.connect(this, &TurnPort::OnSocketClose); | 371 socket_->SignalClose.connect(this, &TurnPort::OnSocketClose); |
372 } else { | 372 } else { |
373 state_ = STATE_CONNECTED; | 373 state_ = STATE_CONNECTED; |
374 } | 374 } |
375 return true; | 375 return true; |
376 } | 376 } |
377 | 377 |
378 void TurnPort::OnSocketConnect(rtc::AsyncPacketSocket* socket) { | 378 void TurnPort::OnSocketConnect(rtc::AsyncPacketSocket* socket) { |
379 RTC_DCHECK(server_address_.proto == PROTO_TCP); | 379 // This slot should only be invoked if we're using a connection-oriented |
| 380 // protocol. |
| 381 RTC_DCHECK(server_address_.proto == PROTO_TCP || |
| 382 server_address_.proto == PROTO_TLS); |
| 383 |
380 // Do not use this port if the socket bound to a different address than | 384 // Do not use this port if the socket bound to a different address than |
381 // the one we asked for. This is seen in Chrome, where TCP sockets cannot be | 385 // the one we asked for. This is seen in Chrome, where TCP sockets cannot be |
382 // given a binding address, and the platform is expected to pick the | 386 // given a binding address, and the platform is expected to pick the |
383 // correct local address. | 387 // correct local address. |
384 | 388 |
385 // However, there are two situations in which we allow the bound address to | 389 // However, there are two situations in which we allow the bound address to |
386 // differ from the requested address: 1. The bound address is the loopback | 390 // differ from the requested address: 1. The bound address is the loopback |
387 // address. This happens when a proxy forces TCP to bind to only the | 391 // address. This happens when a proxy forces TCP to bind to only the |
388 // localhost address (see issue 3927). 2. The bound address is the "any | 392 // localhost address (see issue 3927). 2. The bound address is the "any |
389 // address". This happens when multiple_routes is disabled (see issue 4780). | 393 // address". This happens when multiple_routes is disabled (see issue 4780). |
(...skipping 1188 matching lines...) Loading... |
1578 } else { | 1582 } else { |
1579 state_ = STATE_UNBOUND; | 1583 state_ = STATE_UNBOUND; |
1580 port_->FailAndPruneConnection(ext_addr_); | 1584 port_->FailAndPruneConnection(ext_addr_); |
1581 } | 1585 } |
1582 } | 1586 } |
1583 void TurnEntry::OnChannelBindTimeout() { | 1587 void TurnEntry::OnChannelBindTimeout() { |
1584 state_ = STATE_UNBOUND; | 1588 state_ = STATE_UNBOUND; |
1585 port_->FailAndPruneConnection(ext_addr_); | 1589 port_->FailAndPruneConnection(ext_addr_); |
1586 } | 1590 } |
1587 } // namespace cricket | 1591 } // namespace cricket |
OLD | NEW |