OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 int | 461 int |
462 OpenSSLAdapter::Send(const void* pv, size_t cb) { | 462 OpenSSLAdapter::Send(const void* pv, size_t cb) { |
463 //LOG(LS_INFO) << "OpenSSLAdapter::Send(" << cb << ")"; | 463 //LOG(LS_INFO) << "OpenSSLAdapter::Send(" << cb << ")"; |
464 | 464 |
465 switch (state_) { | 465 switch (state_) { |
466 case SSL_NONE: | 466 case SSL_NONE: |
467 return AsyncSocketAdapter::Send(pv, cb); | 467 return AsyncSocketAdapter::Send(pv, cb); |
468 | 468 |
469 case SSL_WAIT: | 469 case SSL_WAIT: |
470 case SSL_CONNECTING: | 470 case SSL_CONNECTING: |
471 SetError(EWOULDBLOCK); | 471 SetError(ENOTCONN); |
472 return SOCKET_ERROR; | 472 return SOCKET_ERROR; |
473 | 473 |
474 case SSL_CONNECTED: | 474 case SSL_CONNECTED: |
475 break; | 475 break; |
476 | 476 |
477 case SSL_ERROR: | 477 case SSL_ERROR: |
478 default: | 478 default: |
479 return SOCKET_ERROR; | 479 return SOCKET_ERROR; |
480 } | 480 } |
481 | 481 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 527 |
528 int OpenSSLAdapter::Recv(void* pv, size_t cb, int64_t* timestamp) { | 528 int OpenSSLAdapter::Recv(void* pv, size_t cb, int64_t* timestamp) { |
529 //LOG(LS_INFO) << "OpenSSLAdapter::Recv(" << cb << ")"; | 529 //LOG(LS_INFO) << "OpenSSLAdapter::Recv(" << cb << ")"; |
530 switch (state_) { | 530 switch (state_) { |
531 | 531 |
532 case SSL_NONE: | 532 case SSL_NONE: |
533 return AsyncSocketAdapter::Recv(pv, cb, timestamp); | 533 return AsyncSocketAdapter::Recv(pv, cb, timestamp); |
534 | 534 |
535 case SSL_WAIT: | 535 case SSL_WAIT: |
536 case SSL_CONNECTING: | 536 case SSL_CONNECTING: |
537 SetError(EWOULDBLOCK); | 537 SetError(ENOTCONN); |
538 return SOCKET_ERROR; | 538 return SOCKET_ERROR; |
539 | 539 |
540 case SSL_CONNECTED: | 540 case SSL_CONNECTED: |
541 break; | 541 break; |
542 | 542 |
543 case SSL_ERROR: | 543 case SSL_ERROR: |
544 default: | 544 default: |
545 return SOCKET_ERROR; | 545 return SOCKET_ERROR; |
546 } | 546 } |
547 | 547 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 if (ssl_mode_ == SSL_MODE_DTLS) { | 959 if (ssl_mode_ == SSL_MODE_DTLS) { |
960 SSL_CTX_set_read_ahead(ctx, 1); | 960 SSL_CTX_set_read_ahead(ctx, 1); |
961 } | 961 } |
962 | 962 |
963 return ctx; | 963 return ctx; |
964 } | 964 } |
965 | 965 |
966 } // namespace rtc | 966 } // namespace rtc |
967 | 967 |
968 #endif // HAVE_OPENSSL_SSL_H | 968 #endif // HAVE_OPENSSL_SSL_H |
OLD | NEW |