Electroneum
Loading...
Searching...
No Matches
epee::net_utils::http::http_custom_handler< t_connection_context > Class Template Reference

#include <http_protocol_handler.h>

Inheritance diagram for epee::net_utils::http::http_custom_handler< t_connection_context >:
Collaboration diagram for epee::net_utils::http::http_custom_handler< t_connection_context >:

Public Types

typedef custum_handler_config< t_connection_context > config_type
Public Types inherited from epee::net_utils::http::simple_http_connection_handler< net_utils::connection_context_base >
typedef net_utils::connection_context_base connection_context
typedef http_server_config config_type

Public Member Functions

 http_custom_handler (i_service_endpoint *psnd_hndlr, config_type &config, t_connection_context &conn_context)
bool handle_request (const http_request_info &query_info, http_response_info &response)
virtual bool thread_init ()
virtual bool thread_deinit ()
void handle_qued_callback ()
bool after_init_connection ()
Public Member Functions inherited from epee::net_utils::http::simple_http_connection_handler< net_utils::connection_context_base >
 simple_http_connection_handler (i_service_endpoint *psnd_hndlr, config_type &config, net_utils::connection_context_base &conn_context)
virtual ~simple_http_connection_handler ()
bool release_protocol ()
bool after_init_connection ()
virtual bool handle_recv (const void *ptr, size_t cb)

Additional Inherited Members

Protected Attributes inherited from epee::net_utils::http::simple_http_connection_handler< net_utils::connection_context_base >
i_service_endpointm_psnd_hndlr
net_utils::connection_context_basem_conn_context

Detailed Description

template<class t_connection_context = net_utils::connection_context_base>
class epee::net_utils::http::http_custom_handler< t_connection_context >

Definition at line 173 of file http_protocol_handler.h.

Member Typedef Documentation

◆ config_type

template<class t_connection_context = net_utils::connection_context_base>
typedef custum_handler_config<t_connection_context> epee::net_utils::http::http_custom_handler< t_connection_context >::config_type

Definition at line 176 of file http_protocol_handler.h.

Constructor & Destructor Documentation

◆ http_custom_handler()

template<class t_connection_context = net_utils::connection_context_base>
epee::net_utils::http::http_custom_handler< t_connection_context >::http_custom_handler ( i_service_endpoint * psnd_hndlr,
config_type & config,
t_connection_context & conn_context )
inline

Definition at line 178 of file http_protocol_handler.h.

181 m_auth(m_config.m_user ? http_server_auth{*m_config.m_user, config.rng} : http_server_auth{})
182 {}
simple_http_connection_handler(i_service_endpoint *psnd_hndlr, config_type &config, net_utils::connection_context_base &conn_context)
TProtocol::config_type m_config
Here is the call graph for this function:

Member Function Documentation

◆ after_init_connection()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::http_custom_handler< t_connection_context >::after_init_connection ( )
inline

Definition at line 214 of file http_protocol_handler.h.

215 {
216 return true;
217 }

◆ handle_qued_callback()

template<class t_connection_context = net_utils::connection_context_base>
void epee::net_utils::http::http_custom_handler< t_connection_context >::handle_qued_callback ( )
inline

Definition at line 212 of file http_protocol_handler.h.

213 {}

◆ handle_request()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::http_custom_handler< t_connection_context >::handle_request ( const http_request_info & query_info,
http_response_info & response )
inlinevirtual

Reimplemented from epee::net_utils::http::simple_http_connection_handler< net_utils::connection_context_base >.

Definition at line 183 of file http_protocol_handler.h.

184 {
185 CHECK_AND_ASSERT_MES(m_config.m_phandler, false, "m_config.m_phandler is NULL!!!!");
186
187 const auto auth_response = m_auth.get_response(query_info);
188 if (auth_response)
189 {
191 return true;
192 }
193
194 //fill with default values
195 response.m_mime_tipe = "text/plain";
196 response.m_response_code = 200;
197 response.m_response_comment = "OK";
198 response.m_body.clear();
199
200 return m_config.m_phandler->handle_http_request(query_info, response, this->m_conn_context);
201 }
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)

◆ thread_deinit()

template<class t_connection_context = net_utils::connection_context_base>
virtual bool epee::net_utils::http::http_custom_handler< t_connection_context >::thread_deinit ( )
inlinevirtual

Reimplemented from epee::net_utils::http::simple_http_connection_handler< net_utils::connection_context_base >.

Definition at line 208 of file http_protocol_handler.h.

209 {
210 return m_config.m_phandler->deinit_server_thread();
211 }

◆ thread_init()

template<class t_connection_context = net_utils::connection_context_base>
virtual bool epee::net_utils::http::http_custom_handler< t_connection_context >::thread_init ( )
inlinevirtual

Reimplemented from epee::net_utils::http::simple_http_connection_handler< net_utils::connection_context_base >.

Definition at line 203 of file http_protocol_handler.h.

204 {
205 return m_config.m_phandler->init_server_thread();;
206 }

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/contrib/epee/include/net/http_protocol_handler.h