OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 set_dtls_state(DTLS_TRANSPORT_CLOSED); | 564 set_dtls_state(DTLS_TRANSPORT_CLOSED); |
565 } else { | 565 } else { |
566 LOG_J(LS_INFO, this) << "DTLS channel error, code=" << err; | 566 LOG_J(LS_INFO, this) << "DTLS channel error, code=" << err; |
567 set_dtls_state(DTLS_TRANSPORT_FAILED); | 567 set_dtls_state(DTLS_TRANSPORT_FAILED); |
568 } | 568 } |
569 } | 569 } |
570 } | 570 } |
571 | 571 |
572 void DtlsTransportChannelWrapper::MaybeStartDtls() { | 572 void DtlsTransportChannelWrapper::MaybeStartDtls() { |
573 if (dtls_ && channel_->writable()) { | 573 if (dtls_ && channel_->writable()) { |
574 if (dtls_->StartSSLWithPeer()) { | 574 if (dtls_->StartSSL()) { |
575 // This should never fail: | 575 // This should never fail: |
576 // Because we are operating in a nonblocking mode and all | 576 // Because we are operating in a nonblocking mode and all |
577 // incoming packets come in via OnReadPacket(), which rejects | 577 // incoming packets come in via OnReadPacket(), which rejects |
578 // packets in this state, the incoming queue must be empty. We | 578 // packets in this state, the incoming queue must be empty. We |
579 // ignore write errors, thus any errors must be because of | 579 // ignore write errors, thus any errors must be because of |
580 // configuration and therefore are our fault. | 580 // configuration and therefore are our fault. |
581 RTC_DCHECK(false) << "StartSSLWithPeer failed."; | 581 RTC_DCHECK(false) << "StartSSL failed."; |
582 LOG_J(LS_ERROR, this) << "Couldn't start DTLS handshake"; | 582 LOG_J(LS_ERROR, this) << "Couldn't start DTLS handshake"; |
583 set_dtls_state(DTLS_TRANSPORT_FAILED); | 583 set_dtls_state(DTLS_TRANSPORT_FAILED); |
584 return; | 584 return; |
585 } | 585 } |
586 LOG_J(LS_INFO, this) | 586 LOG_J(LS_INFO, this) |
587 << "DtlsTransportChannelWrapper: Started DTLS handshake"; | 587 << "DtlsTransportChannelWrapper: Started DTLS handshake"; |
588 set_dtls_state(DTLS_TRANSPORT_CONNECTING); | 588 set_dtls_state(DTLS_TRANSPORT_CONNECTING); |
589 // Now that the handshake has started, we can process a cached ClientHello | 589 // Now that the handshake has started, we can process a cached ClientHello |
590 // (if one exists). | 590 // (if one exists). |
591 if (cached_client_hello_.size()) { | 591 if (cached_client_hello_.size()) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 last_sent_packet_id, ready_to_send); | 670 last_sent_packet_id, ready_to_send); |
671 } | 671 } |
672 | 672 |
673 void DtlsTransportChannelWrapper::OnChannelStateChanged( | 673 void DtlsTransportChannelWrapper::OnChannelStateChanged( |
674 TransportChannelImpl* channel) { | 674 TransportChannelImpl* channel) { |
675 ASSERT(channel == channel_); | 675 ASSERT(channel == channel_); |
676 SignalStateChanged(this); | 676 SignalStateChanged(this); |
677 } | 677 } |
678 | 678 |
679 } // namespace cricket | 679 } // namespace cricket |
OLD | NEW |