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);
|
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,
|
priority_spec::priority_spec(const int32_t stream_id, const int32_t weight,
|
||||||
const bool exclusive)
|
const bool exclusive)
|
||||||
: valid_(true) {
|
: 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(); }
|
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(
|
void session_tls_impl::read_socket(
|
||||||
std::function<void(const boost::system::error_code &ec, std::size_t n)> h) {
|
std::function<void(const boost::system::error_code &ec, std::size_t n)> h) {
|
||||||
socket_.async_read_some(boost::asio::buffer(rb_), 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 void start_connect(tcp::resolver::iterator endpoint_it);
|
||||||
virtual tcp::socket &socket();
|
virtual tcp::socket &socket();
|
||||||
|
virtual SSL* native_handle();
|
||||||
virtual void read_socket(
|
virtual void read_socket(
|
||||||
std::function<void(const boost::system::error_code &ec, std::size_t n)>
|
std::function<void(const boost::system::error_code &ec, std::size_t n)>
|
||||||
h);
|
h);
|
||||||
|
|
|
@ -233,6 +233,7 @@ public:
|
||||||
generator_cb cb, header_map h = header_map{},
|
generator_cb cb, header_map h = header_map{},
|
||||||
priority_spec prio = priority_spec()) const;
|
priority_spec prio = priority_spec()) const;
|
||||||
|
|
||||||
|
SSL *tls_native_handle();
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<session_impl> impl_;
|
std::shared_ptr<session_impl> impl_;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue