Monero
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
epee::net_utils::http::http_simple_client_template< net_client_type > Class Template Reference

#include <http_client.h>

Inheritance diagram for epee::net_utils::http::http_simple_client_template< net_client_type >:
Inheritance graph
[legend]
Collaboration diagram for epee::net_utils::http::http_simple_client_template< net_client_type >:
Collaboration graph
[legend]

Public Member Functions

 http_simple_client_template ()
 
const std::string & get_host () const
 
const std::string & get_port () const
 
void set_server (std::string host, std::string port, boost::optional< login > user, ssl_options_t ssl_options=ssl_support_t::e_ssl_support_autodetect) override
 
void set_auto_connect (bool auto_connect) override
 
template<typename F >
void set_connector (F connector)
 
bool connect (std::chrono::milliseconds timeout) override
 
bool disconnect () override
 
bool is_connected (bool *ssl=NULL) override
 
virtual bool handle_target_data (std::string &piece_of_transfer) override
 
virtual bool on_header (const http_response_info &headers)
 
bool invoke_get (const boost::string_ref uri, std::chrono::milliseconds timeout, const std::string &body=std::string(), const http_response_info **ppresponse_info=NULL, const fields_list &additional_params=fields_list()) override
 
bool invoke (const boost::string_ref uri, const boost::string_ref method, const boost::string_ref body, std::chrono::milliseconds timeout, const http_response_info **ppresponse_info=NULL, const fields_list &additional_params=fields_list()) override
 
bool invoke_post (const boost::string_ref uri, const std::string &body, std::chrono::milliseconds timeout, const http_response_info **ppresponse_info=NULL, const fields_list &additional_params=fields_list()) override
 
bool test (const std::string &s, std::chrono::milliseconds timeout)
 
uint64_t get_bytes_sent () const override
 
uint64_t get_bytes_received () const override
 
void wipe_response ()
 
bool set_server (const std::string &address, boost::optional< login > user, ssl_options_t ssl_options=ssl_support_t::e_ssl_support_autodetect)
 
virtual void set_server (std::string host, std::string port, boost::optional< login > user, ssl_options_t ssl_options=ssl_support_t::e_ssl_support_autodetect)=0
 
- Public Member Functions inherited from epee::net_utils::i_target_handler
virtual ~i_target_handler ()
 
- Public Member Functions inherited from epee::net_utils::http::abstract_http_client
 abstract_http_client ()
 
virtual ~abstract_http_client ()
 
bool set_server (const std::string &address, boost::optional< login > user, ssl_options_t ssl_options=ssl_support_t::e_ssl_support_autodetect)
 
virtual bool set_proxy (const std::string &address)
 

Private Types

enum  reciev_machine_state {
  reciev_machine_state_header, reciev_machine_state_body_content_len, reciev_machine_state_body_connection_close, reciev_machine_state_body_chunked,
  reciev_machine_state_done, reciev_machine_state_error
}
 
enum  chunked_state { http_chunked_state_chunk_head, http_chunked_state_chunk_body, http_chunked_state_done, http_chunked_state_undefined }
 

Private Member Functions

bool handle_reciev (std::chrono::milliseconds timeout)
 
bool handle_header (std::string &recv_buff, bool &need_more_data)
 
bool handle_body_content_len (std::string &recv_buff, bool &need_more_data)
 
bool handle_body_connection_close (std::string &recv_buff, bool &need_more_data)
 
bool is_hex_symbol (char ch)
 
bool get_len_from_chunk_head (const std::string &chunk_head, size_t &result_size)
 
bool get_chunk_head (std::string &buff, size_t &chunk_size, bool &is_matched)
 
bool handle_body_body_chunked (std::string &recv_buff, bool &need_more_data)
 
bool parse_header (http_header_info &body_info, const std::string &m_cache_to_process)
 
bool analize_first_response_line ()
 
bool set_reply_content_encoder ()
 
bool analize_cached_header_and_invoke_state ()
 
bool is_connection_close_field (const std::string &str)
 
bool is_multipart_body (const http_header_info &head_info, OUT std::string &boundary)
 

Private Attributes

net_client_type m_net_client
 
std::string m_host_buff
 
std::string m_port
 
http_client_auth m_auth
 
std::string m_header_cache
 
http_response_info m_response_info
 
size_t m_len_in_summary
 
size_t m_len_in_remain
 
boost::shared_ptr< i_sub_handlerm_pcontent_encoding_handler
 
reciev_machine_state m_state
 
chunked_state m_chunked_state
 
std::string m_chunked_cache
 
bool m_auto_connect
 
critical_section m_lock
 

Member Enumeration Documentation

◆ chunked_state

template<typename net_client_type >
enum epee::net_utils::http::http_simple_client_template::chunked_state
private
Enumerator
http_chunked_state_chunk_head 
http_chunked_state_chunk_body 
http_chunked_state_done 
http_chunked_state_undefined 

◆ reciev_machine_state

template<typename net_client_type >
enum epee::net_utils::http::http_simple_client_template::reciev_machine_state
private
Enumerator
reciev_machine_state_header 
reciev_machine_state_body_content_len 
reciev_machine_state_body_connection_close 
reciev_machine_state_body_chunked 
reciev_machine_state_done 
reciev_machine_state_error 

Constructor & Destructor Documentation

◆ http_simple_client_template()

template<typename net_client_type >
epee::net_utils::http::http_simple_client_template< net_client_type >::http_simple_client_template ( )
inlineexplicit

Member Function Documentation

◆ analize_cached_header_and_invoke_state()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::analize_cached_header_and_invoke_state ( )
inlineprivate

◆ analize_first_response_line()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::analize_first_response_line ( )
inlineprivate

◆ connect()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::connect ( std::chrono::milliseconds  timeout)
inlineoverridevirtual

◆ disconnect()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::disconnect ( )
inlineoverridevirtual

◆ get_bytes_received()

template<typename net_client_type >
uint64_t epee::net_utils::http::http_simple_client_template< net_client_type >::get_bytes_received ( ) const
inlineoverridevirtual

◆ get_bytes_sent()

template<typename net_client_type >
uint64_t epee::net_utils::http::http_simple_client_template< net_client_type >::get_bytes_sent ( ) const
inlineoverridevirtual

◆ get_chunk_head()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::get_chunk_head ( std::string &  buff,
size_t &  chunk_size,
bool is_matched 
)
inlineprivate

◆ get_host()

template<typename net_client_type >
const std::string& epee::net_utils::http::http_simple_client_template< net_client_type >::get_host ( ) const
inline

◆ get_len_from_chunk_head()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::get_len_from_chunk_head ( const std::string &  chunk_head,
size_t &  result_size 
)
inlineprivate

◆ get_port()

template<typename net_client_type >
const std::string& epee::net_utils::http::http_simple_client_template< net_client_type >::get_port ( ) const
inline

◆ handle_body_body_chunked()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::handle_body_body_chunked ( std::string &  recv_buff,
bool need_more_data 
)
inlineprivate

◆ handle_body_connection_close()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::handle_body_connection_close ( std::string &  recv_buff,
bool need_more_data 
)
inlineprivate

◆ handle_body_content_len()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::handle_body_content_len ( std::string &  recv_buff,
bool need_more_data 
)
inlineprivate

◆ handle_header()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::handle_header ( std::string &  recv_buff,
bool need_more_data 
)
inlineprivate

◆ handle_reciev()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::handle_reciev ( std::chrono::milliseconds  timeout)
inlineprivate

◆ handle_target_data()

template<typename net_client_type >
virtual bool epee::net_utils::http::http_simple_client_template< net_client_type >::handle_target_data ( std::string &  piece_of_transfer)
inlineoverridevirtual

◆ invoke()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::invoke ( const boost::string_ref  uri,
const boost::string_ref  method,
const boost::string_ref  body,
std::chrono::milliseconds  timeout,
const http_response_info **  ppresponse_info = NULL,
const fields_list additional_params = fields_list() 
)
inlineoverridevirtual

◆ invoke_get()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::invoke_get ( const boost::string_ref  uri,
std::chrono::milliseconds  timeout,
const std::string &  body = std::string(),
const http_response_info **  ppresponse_info = NULL,
const fields_list additional_params = fields_list() 
)
inlineoverridevirtual

◆ invoke_post()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::invoke_post ( const boost::string_ref  uri,
const std::string &  body,
std::chrono::milliseconds  timeout,
const http_response_info **  ppresponse_info = NULL,
const fields_list additional_params = fields_list() 
)
inlineoverridevirtual

◆ is_connected()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::is_connected ( bool ssl = NULL)
inlineoverridevirtual

◆ is_connection_close_field()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::is_connection_close_field ( const std::string &  str)
inlineprivate

◆ is_hex_symbol()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::is_hex_symbol ( char  ch)
inlineprivate

◆ is_multipart_body()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::is_multipart_body ( const http_header_info head_info,
OUT std::string &  boundary 
)
inlineprivate

◆ on_header()

template<typename net_client_type >
virtual bool epee::net_utils::http::http_simple_client_template< net_client_type >::on_header ( const http_response_info headers)
inlinevirtual

◆ parse_header()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::parse_header ( http_header_info body_info,
const std::string &  m_cache_to_process 
)
inlineprivate

◆ set_auto_connect()

template<typename net_client_type >
void epee::net_utils::http::http_simple_client_template< net_client_type >::set_auto_connect ( bool  auto_connect)
inlineoverridevirtual

◆ set_connector()

template<typename net_client_type >
template<typename F >
void epee::net_utils::http::http_simple_client_template< net_client_type >::set_connector ( F  connector)
inline

◆ set_reply_content_encoder()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::set_reply_content_encoder ( )
inlineprivate

◆ set_server() [1/3]

template<typename net_client_type >
bool epee::net_utils::http::abstract_http_client::set_server

◆ set_server() [2/3]

template<typename net_client_type >
virtual void epee::net_utils::http::abstract_http_client::set_server

◆ set_server() [3/3]

template<typename net_client_type >
void epee::net_utils::http::http_simple_client_template< net_client_type >::set_server ( std::string  host,
std::string  port,
boost::optional< login user,
ssl_options_t  ssl_options = ssl_support_t::e_ssl_support_autodetect 
)
inlineoverridevirtual

◆ test()

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::test ( const std::string &  s,
std::chrono::milliseconds  timeout 
)
inline

◆ wipe_response()

template<typename net_client_type >
void epee::net_utils::http::http_simple_client_template< net_client_type >::wipe_response ( )
inline

Member Data Documentation

◆ m_auth

template<typename net_client_type >
http_client_auth epee::net_utils::http::http_simple_client_template< net_client_type >::m_auth
private

◆ m_auto_connect

template<typename net_client_type >
bool epee::net_utils::http::http_simple_client_template< net_client_type >::m_auto_connect
private

◆ m_chunked_cache

template<typename net_client_type >
std::string epee::net_utils::http::http_simple_client_template< net_client_type >::m_chunked_cache
private

◆ m_chunked_state

template<typename net_client_type >
chunked_state epee::net_utils::http::http_simple_client_template< net_client_type >::m_chunked_state
private

◆ m_header_cache

template<typename net_client_type >
std::string epee::net_utils::http::http_simple_client_template< net_client_type >::m_header_cache
private

◆ m_host_buff

template<typename net_client_type >
std::string epee::net_utils::http::http_simple_client_template< net_client_type >::m_host_buff
private

◆ m_len_in_remain

template<typename net_client_type >
size_t epee::net_utils::http::http_simple_client_template< net_client_type >::m_len_in_remain
private

◆ m_len_in_summary

template<typename net_client_type >
size_t epee::net_utils::http::http_simple_client_template< net_client_type >::m_len_in_summary
private

◆ m_lock

template<typename net_client_type >
critical_section epee::net_utils::http::http_simple_client_template< net_client_type >::m_lock
private

◆ m_net_client

template<typename net_client_type >
net_client_type epee::net_utils::http::http_simple_client_template< net_client_type >::m_net_client
private

◆ m_pcontent_encoding_handler

template<typename net_client_type >
boost::shared_ptr<i_sub_handler> epee::net_utils::http::http_simple_client_template< net_client_type >::m_pcontent_encoding_handler
private

◆ m_port

template<typename net_client_type >
std::string epee::net_utils::http::http_simple_client_template< net_client_type >::m_port
private

◆ m_response_info

template<typename net_client_type >
http_response_info epee::net_utils::http::http_simple_client_template< net_client_type >::m_response_info
private

◆ m_state

template<typename net_client_type >
reciev_machine_state epee::net_utils::http::http_simple_client_template< net_client_type >::m_state
private

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