Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lowest_layer() that's also present in ssl::stream #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions include/boost/wintls/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class stream {
/// The type of the next layer.
using next_layer_type = typename std::remove_reference<NextLayer>::type;

#if !defined(BOOST_ASIO_NO_EXTENSIONS)
/// The type of the lowest layer.
typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
#endif

/// The type of the executor associated with the object.
using executor_type = typename std::remove_reference<next_layer_type>::type::executor_type;

Expand Down Expand Up @@ -100,6 +105,34 @@ class stream {
return next_layer_;
}

#if !defined(BOOST_ASIO_NO_EXTENSIONS)
/// Get a reference to the lowest layer.
/**
* This function returns a reference to the lowest layer in a stack of
* stream layers.
*
* @return A reference to the lowest layer in the stack of stream layers.
* Ownership is not transferred to the caller.
*/
lowest_layer_type& lowest_layer()
{
return next_layer_.lowest_layer();
}

/// Get a reference to the lowest layer.
/**
* This function returns a reference to the lowest layer in a stack of
* stream layers.
*
* @return A reference to the lowest layer in the stack of stream layers.
* Ownership is not transferred to the caller.
*/
const lowest_layer_type& lowest_layer() const
{
return next_layer_.lowest_layer();
}
#endif

/** Set SNI hostname
*
* Sets the SNI hostname the client will use for requesting and
Expand Down