Monero
Loading...
Searching...
No Matches
epee::net_utils::http::simple_http_connection_handler< t_connection_context > Class Template Reference

#include <http_protocol_handler.h>

Collaboration diagram for epee::net_utils::http::simple_http_connection_handler< t_connection_context >:

Public Types

typedef t_connection_context connection_context
typedef http_server_config config_type

Public Member Functions

 simple_http_connection_handler (i_service_endpoint *psnd_hndlr, config_type &config, t_connection_context &conn_context)
virtual ~simple_http_connection_handler ()
bool release_protocol ()
virtual bool thread_init ()
virtual bool thread_deinit ()
bool after_init_connection ()
virtual bool handle_recv (const void *ptr, size_t cb)
virtual bool handle_request (const http::http_request_info &query_info, http_response_info &response)

Protected Attributes

i_service_endpointm_psnd_hndlr
t_connection_context & m_conn_context
bool m_initialized

Private Types

enum  machine_state {
  http_state_retriving_comand_line , http_state_retriving_header , http_state_retriving_body , http_state_connection_close ,
  http_state_error
}
enum  body_transfer_type {
  http_body_transfer_chunked , http_body_transfer_measure , http_body_transfer_chunked_instead_measure , http_body_transfer_connection_close ,
  http_body_transfer_multipart , http_body_transfer_undefined
}

Private Member Functions

bool handle_buff_in (std::string &buf)
bool analize_cached_request_header_and_invoke_state (size_t pos)
bool handle_invoke_query_line ()
bool parse_cached_header (http_header_info &body_info, const std::string &m_cache_to_process, size_t pos)
std::string::size_type match_end_of_header (const std::string &buf)
bool get_len_from_content_lenght (const std::string &str, size_t &len)
bool handle_retriving_query_body ()
bool handle_query_measure ()
bool set_ready_state ()
bool slash_to_back_slash (std::string &str)
std::string get_file_mime_tipe (const std::string &path)
std::string get_response_header (const http_response_info &response)
bool handle_request_and_send_response (const http::http_request_info &query_info)
std::string get_not_found_response_body (const std::string &URI)

Private Attributes

std::string m_root_path
std::string m_cache
machine_state m_state
body_transfer_type m_body_transfer_type
bool m_is_stop_handling
http::http_request_info m_query_info
size_t m_len_summary
size_t m_len_remain
config_typem_config
bool m_want_close
size_t m_newlines
size_t m_bytes_read

Member Typedef Documentation

◆ config_type

template<class t_connection_context = net_utils::connection_context_base>
typedef http_server_config epee::net_utils::http::simple_http_connection_handler< t_connection_context >::config_type

◆ connection_context

template<class t_connection_context = net_utils::connection_context_base>
typedef t_connection_context epee::net_utils::http::simple_http_connection_handler< t_connection_context >::connection_context

Member Enumeration Documentation

◆ body_transfer_type

template<class t_connection_context = net_utils::connection_context_base>
enum epee::net_utils::http::simple_http_connection_handler::body_transfer_type
private
Enumerator
http_body_transfer_chunked 
http_body_transfer_measure 
http_body_transfer_chunked_instead_measure 
http_body_transfer_connection_close 
http_body_transfer_multipart 
http_body_transfer_undefined 

◆ machine_state

template<class t_connection_context = net_utils::connection_context_base>
enum epee::net_utils::http::simple_http_connection_handler::machine_state
private
Enumerator
http_state_retriving_comand_line 
http_state_retriving_header 
http_state_retriving_body 
http_state_connection_close 
http_state_error 

Constructor & Destructor Documentation

◆ simple_http_connection_handler()

template<class t_connection_context>
epee::net_utils::http::simple_http_connection_handler< t_connection_context >::simple_http_connection_handler ( i_service_endpoint * psnd_hndlr,
config_type & config,
t_connection_context & conn_context )

◆ ~simple_http_connection_handler()

template<class t_connection_context>
epee::net_utils::http::simple_http_connection_handler< t_connection_context >::~simple_http_connection_handler ( )
virtual

Member Function Documentation

◆ after_init_connection()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::after_init_connection ( )

◆ analize_cached_request_header_and_invoke_state()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::analize_cached_request_header_and_invoke_state ( size_t pos)
private

◆ get_file_mime_tipe()

template<class t_connection_context>
std::string epee::net_utils::http::simple_http_connection_handler< t_connection_context >::get_file_mime_tipe ( const std::string & path)
private

◆ get_len_from_content_lenght()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::get_len_from_content_lenght ( const std::string & str,
size_t & len )
private

◆ get_not_found_response_body()

template<class t_connection_context>
std::string epee::net_utils::http::simple_http_connection_handler< t_connection_context >::get_not_found_response_body ( const std::string & URI)
private

◆ get_response_header()

template<class t_connection_context>
std::string epee::net_utils::http::simple_http_connection_handler< t_connection_context >::get_response_header ( const http_response_info & response)
private

◆ handle_buff_in()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_buff_in ( std::string & buf)
private

◆ handle_invoke_query_line()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_invoke_query_line ( )
private

◆ handle_query_measure()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_query_measure ( )
private

◆ handle_recv()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_recv ( const void * ptr,
size_t cb )
virtual

◆ handle_request()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_request ( const http::http_request_info & query_info,
http_response_info & response )
virtual

◆ handle_request_and_send_response()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_request_and_send_response ( const http::http_request_info & query_info)
inlineprivate

◆ handle_retriving_query_body()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::handle_retriving_query_body ( )
private

◆ match_end_of_header()

template<class t_connection_context>
std::string::size_type epee::net_utils::http::simple_http_connection_handler< t_connection_context >::match_end_of_header ( const std::string & buf)
private

◆ parse_cached_header()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::parse_cached_header ( http_header_info & body_info,
const std::string & m_cache_to_process,
size_t pos )
private

◆ release_protocol()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::release_protocol ( )
inline

◆ set_ready_state()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::set_ready_state ( )
private

◆ slash_to_back_slash()

template<class t_connection_context>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::slash_to_back_slash ( std::string & str)
private

◆ thread_deinit()

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

◆ thread_init()

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

Member Data Documentation

◆ m_body_transfer_type

template<class t_connection_context = net_utils::connection_context_base>
body_transfer_type epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_body_transfer_type
private

◆ m_bytes_read

template<class t_connection_context = net_utils::connection_context_base>
size_t epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_bytes_read
private

◆ m_cache

template<class t_connection_context = net_utils::connection_context_base>
std::string epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_cache
private

◆ m_config

template<class t_connection_context = net_utils::connection_context_base>
config_type& epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_config
private

◆ m_conn_context

template<class t_connection_context = net_utils::connection_context_base>
t_connection_context& epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_conn_context
protected

◆ m_initialized

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_initialized
protected

◆ m_is_stop_handling

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_is_stop_handling
private

◆ m_len_remain

template<class t_connection_context = net_utils::connection_context_base>
size_t epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_len_remain
private

◆ m_len_summary

template<class t_connection_context = net_utils::connection_context_base>
size_t epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_len_summary
private

◆ m_newlines

template<class t_connection_context = net_utils::connection_context_base>
size_t epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_newlines
private

◆ m_psnd_hndlr

template<class t_connection_context = net_utils::connection_context_base>
i_service_endpoint* epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_psnd_hndlr
protected

◆ m_query_info

template<class t_connection_context = net_utils::connection_context_base>
http::http_request_info epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_query_info
private

◆ m_root_path

template<class t_connection_context = net_utils::connection_context_base>
std::string epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_root_path
private

◆ m_state

template<class t_connection_context = net_utils::connection_context_base>
machine_state epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_state
private

◆ m_want_close

template<class t_connection_context = net_utils::connection_context_base>
bool epee::net_utils::http::simple_http_connection_handler< t_connection_context >::m_want_close
private

The documentation for this class was generated from the following files: