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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 // By this point, OpenSSL should have given us a certificate, or errored | 858 // By this point, OpenSSL should have given us a certificate, or errored |
859 // out if one was missing. | 859 // out if one was missing. |
860 RTC_DCHECK(peer_certificate_ || !client_auth_enabled()); | 860 RTC_DCHECK(peer_certificate_ || !client_auth_enabled()); |
861 | 861 |
862 state_ = SSL_CONNECTED; | 862 state_ = SSL_CONNECTED; |
863 if (!waiting_to_verify_peer_certificate()) { | 863 if (!waiting_to_verify_peer_certificate()) { |
864 // We have everything we need to start the connection, so signal | 864 // We have everything we need to start the connection, so signal |
865 // SE_OPEN. If we need a client certificate fingerprint and don't have | 865 // SE_OPEN. If we need a client certificate fingerprint and don't have |
866 // it yet, we'll instead signal SE_OPEN in SetPeerCertificateDigest. | 866 // it yet, we'll instead signal SE_OPEN in SetPeerCertificateDigest. |
867 // | 867 // |
868 // Post the event asynchronously to unwind the stack. The | 868 // TODO(deadbeef): Post this event asynchronously to unwind the stack. |
869 // caller of ContinueSSL may be the same object listening | 869 // The caller of ContinueSSL may be the same object listening for these |
870 // for these events and may not be prepared for reentrancy. | 870 // events and may not be prepared for reentrancy. |
871 PostEvent(SE_OPEN | SE_READ | SE_WRITE, 0); | 871 // PostEvent(SE_OPEN | SE_READ | SE_WRITE, 0); |
| 872 StreamAdapterInterface::OnEvent(stream(), SE_OPEN | SE_READ | SE_WRITE, |
| 873 0); |
872 } | 874 } |
873 break; | 875 break; |
874 | 876 |
875 case SSL_ERROR_WANT_READ: { | 877 case SSL_ERROR_WANT_READ: { |
876 LOG(LS_VERBOSE) << " -- error want read"; | 878 LOG(LS_VERBOSE) << " -- error want read"; |
877 struct timeval timeout; | 879 struct timeval timeout; |
878 if (DTLSv1_get_timeout(ssl_, &timeout)) { | 880 if (DTLSv1_get_timeout(ssl_, &timeout)) { |
879 int delay = timeout.tv_sec * 1000 + timeout.tv_usec/1000; | 881 int delay = timeout.tv_sec * 1000 + timeout.tv_usec/1000; |
880 | 882 |
881 Thread::Current()->PostDelayed(RTC_FROM_HERE, delay, this, | 883 Thread::Current()->PostDelayed(RTC_FROM_HERE, delay, this, |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 return true; | 1259 return true; |
1258 } | 1260 } |
1259 } | 1261 } |
1260 | 1262 |
1261 return false; | 1263 return false; |
1262 } | 1264 } |
1263 | 1265 |
1264 } // namespace rtc | 1266 } // namespace rtc |
1265 | 1267 |
1266 #endif // HAVE_OPENSSL_SSL_H | 1268 #endif // HAVE_OPENSSL_SSL_H |
OLD | NEW |