Expose TLS handle
This commit is contained in:
parent
2d5f76594a
commit
7441429365
|
@ -140,6 +140,13 @@ void session::read_timeout(const boost::posix_time::time_duration &t) {
|
|||
impl_->read_timeout(t);
|
||||
}
|
||||
|
||||
SSL *session::tls_native_handle() {
|
||||
if(session_tls_impl* i=dynamic_cast<session_tls_impl*>(impl_.get())) {
|
||||
return i->native_handle();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
priority_spec::priority_spec(const int32_t stream_id, const int32_t weight,
|
||||
const bool exclusive)
|
||||
: valid_(true) {
|
||||
|
|
|
@ -86,6 +86,8 @@ void session_tls_impl::start_connect(tcp::resolver::iterator endpoint_it) {
|
|||
|
||||
tcp::socket &session_tls_impl::socket() { return socket_.next_layer(); }
|
||||
|
||||
SSL *session_tls_impl::native_handle() { return socket_.native_handle(); }
|
||||
|
||||
void session_tls_impl::read_socket(
|
||||
std::function<void(const boost::system::error_code &ec, std::size_t n)> h) {
|
||||
socket_.async_read_some(boost::asio::buffer(rb_), h);
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
|
||||
virtual void start_connect(tcp::resolver::iterator endpoint_it);
|
||||
virtual tcp::socket &socket();
|
||||
virtual SSL* native_handle();
|
||||
virtual void read_socket(
|
||||
std::function<void(const boost::system::error_code &ec, std::size_t n)>
|
||||
h);
|
||||
|
|
|
@ -233,6 +233,7 @@ public:
|
|||
generator_cb cb, header_map h = header_map{},
|
||||
priority_spec prio = priority_spec()) const;
|
||||
|
||||
SSL *tls_native_handle();
|
||||
private:
|
||||
std::shared_ptr<session_impl> impl_;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue