| 665 | |
| 666 | |
| 667 | Session::Ptr SecureSocketImpl::currentSession() |
| 668 | { |
| 669 | ScopedLock lock(*_mutex); |
| 670 | if (_pSSL) |
| 671 | { |
| 672 | SSL_SESSION* pSession = SSL_get1_session(_pSSL); |
| 673 | if (pSession) |
| 674 | { |
| 675 | if (_pSession && pSession == _pSession->sslSession()) |
| 676 | { |
| 677 | SSL_SESSION_free(pSession); |
| 678 | return _pSession; |
| 679 | } |
| 680 | else return new Session(pSession); |
| 681 | } |
| 682 | } |
| 683 | return 0; |
| 684 | } |
| 685 | |
| 686 | |
| 687 | void SecureSocketImpl::useSession(Session::Ptr pSession) |