SMACC2
|
#include <ssl_http_session.hpp>
Public Member Functions | |
ssl_http_session (boost::asio::any_io_executor ioc, boost::asio::ssl::context &ssl_context, const std::function< void(const TResponse &)> response) | |
virtual | ~ssl_http_session () |
void | run (const std::string &host, const std::string &target, const boost::beast::http::verb http_method, const int &version) override |
std::string | getPort () override |
Public Member Functions inherited from cl_http::http_session_base | |
virtual | ~http_session_base () |
Private Member Functions | |
void | on_resolve (boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type results) override |
void | fail (boost::beast::error_code ec, const char *what) override |
void | on_connect (boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type::endpoint_type) override |
void | on_handshake (boost::beast::error_code ec) override |
void | on_write (boost::beast::error_code ec, std::size_t bytes_transferred) override |
void | on_read (boost::beast::error_code ec, std::size_t bytes_transferred) override |
void | on_shutdown (boost::beast::error_code ec) override |
void | setBody (const std::string &body) override |
void | setHeaders (const std::unordered_map< std::string, std::string > &headers) override |
void | appendToHeader (const std::string &key, const std::string &val) |
Private Attributes | |
const std::string | kPort = "443" |
std::function< void(const TResponse &)> | onResponse |
boost::asio::ip::tcp::resolver | resolver_ |
boost::beast::ssl_stream< boost::beast::tcp_stream > | stream_ |
boost::beast::flat_buffer | buffer_ |
boost::beast::http::request< boost::beast::http::string_body > | req_ |
TResponse | res_ |
Additional Inherited Members | |
Public Types inherited from cl_http::http_session_base | |
using | TResponse = boost::beast::http::response< boost::beast::http::string_body > |
Definition at line 37 of file ssl_http_session.hpp.
cl_http::ssl_http_session::ssl_http_session | ( | boost::asio::any_io_executor | ioc, |
boost::asio::ssl::context & | ssl_context, | ||
const std::function< void(const TResponse &)> | response | ||
) |
Definition at line 27 of file ssl_http_session.cpp.
|
inlinevirtual |
Definition at line 47 of file ssl_http_session.hpp.
|
private |
Definition at line 44 of file ssl_http_session.cpp.
References req_.
Referenced by setHeaders().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 87 of file ssl_http_session.cpp.
References onResponse, and res_.
Referenced by on_connect(), on_handshake(), on_read(), on_resolve(), and on_write().
|
inlineoverridevirtual |
Implements cl_http::http_session_base.
Definition at line 54 of file ssl_http_session.hpp.
References kPort.
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 96 of file ssl_http_session.cpp.
References fail(), on_handshake(), and stream_.
Referenced by on_resolve().
|
overrideprivatevirtual |
Reimplemented from cl_http::http_session_base.
Definition at line 110 of file ssl_http_session.cpp.
References fail(), on_write(), req_, and stream_.
Referenced by on_connect().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 135 of file ssl_http_session.cpp.
References fail(), on_shutdown(), and stream_.
Referenced by on_write().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 74 of file ssl_http_session.cpp.
References fail(), on_connect(), and stream_.
Referenced by run().
|
overrideprivatevirtual |
Reimplemented from cl_http::http_session_base.
Definition at line 149 of file ssl_http_session.cpp.
References onResponse, and res_.
Referenced by on_read().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 123 of file ssl_http_session.cpp.
References buffer_, fail(), on_read(), res_, and stream_.
Referenced by on_handshake().
|
overridevirtual |
Implements cl_http::http_session_base.
Definition at line 49 of file ssl_http_session.cpp.
References kPort, on_resolve(), req_, resolver_, and stream_.
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 34 of file ssl_http_session.cpp.
References req_.
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 36 of file ssl_http_session.cpp.
References appendToHeader().
|
private |
Definition at line 78 of file ssl_http_session.hpp.
Referenced by on_write().
|
private |
Definition at line 57 of file ssl_http_session.hpp.
|
private |
Definition at line 73 of file ssl_http_session.hpp.
Referenced by fail(), and on_shutdown().
|
private |
Definition at line 79 of file ssl_http_session.hpp.
Referenced by appendToHeader(), on_handshake(), run(), and setBody().
|
private |
Definition at line 80 of file ssl_http_session.hpp.
Referenced by fail(), on_shutdown(), and on_write().
|
private |
Definition at line 75 of file ssl_http_session.hpp.
Referenced by run().
|
private |
Definition at line 77 of file ssl_http_session.hpp.
Referenced by on_connect(), on_handshake(), on_read(), on_resolve(), on_write(), and run().