Instrument Neutral Distributed Interface INDI 2.2.5
httplib::detail Namespace Reference

Namespaces

namespace  case_ignore
namespace  fields
namespace  udl

Classes

struct  scope_exit
class  MatcherBase
class  PathParamsMatcher
class  RegexMatcher
struct  BodyReader
struct  FileStat
class  BufferStream
class  compressor
class  decompressor
class  nocompressor
class  stream_line_reader
struct  ChunkedDecoder
class  mmap
class  SocketStream
class  FormDataParser
class  ContentProviderAdapter

Enumerations

enum class  EncodingType { None = 0 , Gzip , Brotli , Zstd }
enum class  ReadContentResult { Success , PayloadTooLarge , Error }

Functions

template<class T, class... Args>
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique (Args &&...args)
template<class T>
std::enable_if< std::is_array< T >::value, std::unique_ptr< T > >::type make_unique (std::size_t n)
int close_socket (socket_t sock)
ssize_t write_headers (Stream &strm, const Headers &headers)
ssize_t read_body_content (Stream *stream, BodyReader &br, char *buf, size_t len)
template<typename T, typename U>
void duration_to_sec_and_usec (const T &duration, U callback)
template<size_t N>
constexpr size_t str_len (const char(&)[N])
bool is_numeric (const std::string &str)
size_t get_header_value_u64 (const Headers &headers, const std::string &key, size_t def, size_t id, bool &is_invalid_value)
size_t get_header_value_u64 (const Headers &headers, const std::string &key, size_t def, size_t id)
bool set_socket_opt_impl (socket_t sock, int level, int optname, const void *optval, socklen_t optlen)
bool set_socket_opt (socket_t sock, int level, int optname, int optval)
bool set_socket_opt_time (socket_t sock, int level, int optname, time_t sec, time_t usec)
std::string make_host_and_port_string (const std::string &host, int port, bool is_ssl)
std::string trim_copy (const std::string &s)
void divide (const char *data, std::size_t size, char d, std::function< void(const char *, std::size_t, const char *, std::size_t)> fn)
void divide (const std::string &str, char d, std::function< void(const char *, std::size_t, const char *, std::size_t)> fn)
void split (const char *b, const char *e, char d, std::function< void(const char *, const char *)> fn)
void split (const char *b, const char *e, char d, size_t m, std::function< void(const char *, const char *)> fn)
bool process_client_socket (socket_t sock, time_t read_timeout_sec, time_t read_timeout_usec, time_t write_timeout_sec, time_t write_timeout_usec, time_t max_timeout_msec, std::chrono::time_point< std::chrono::steady_clock > start_time, std::function< bool(Stream &)> callback)
socket_t create_client_socket (const std::string &host, const std::string &ip, int port, int address_family, bool tcp_nodelay, bool ipv6_v6only, SocketOptions socket_options, time_t connection_timeout_sec, time_t connection_timeout_usec, time_t read_timeout_sec, time_t read_timeout_usec, time_t write_timeout_sec, time_t write_timeout_usec, const std::string &intf, Error &error)
const char * get_header_value (const Headers &headers, const std::string &key, const char *def, size_t id)
std::string params_to_query_str (const Params &params)
void parse_query_text (const char *data, std::size_t size, Params &params)
void parse_query_text (const std::string &s, Params &params)
bool parse_multipart_boundary (const std::string &content_type, std::string &boundary)
bool parse_range_header (const std::string &s, Ranges &ranges)
bool parse_accept_header (const std::string &s, std::vector< std::string > &content_types)
ssize_t send_socket (socket_t sock, const void *ptr, size_t size, int flags)
ssize_t read_socket (socket_t sock, void *ptr, size_t size, int flags)
EncodingType encoding_type (const Request &req, const Response &res)
bool parse_trailers (stream_line_reader &line_reader, Headers &dest, const Headers &src_headers)
bool is_hex (char c, int &v)
bool from_hex_to_i (const std::string &s, size_t i, size_t cnt, int &val)
std::string from_i_to_hex (size_t n)
std::string compute_etag (const FileStat &fs)
std::string file_mtime_to_http_date (time_t mtime)
time_t parse_http_date (const std::string &date_str)
bool is_weak_etag (const std::string &s)
bool is_strong_etag (const std::string &s)
size_t to_utf8 (int code, char *buff)
std::string base64_encode (const std::string &in)
bool is_valid_path (const std::string &path)
std::string encode_path (const std::string &s)
std::string file_extension (const std::string &path)
bool is_space_or_tab (char c)
template<typename T>
bool parse_header (const char *beg, const char *end, T fn)
std::pair< size_t, size_t > trim (const char *b, const char *e, size_t left, size_t right)
std::string trim_double_quotes_copy (const std::string &s)
bool split_find (const char *b, const char *e, char d, size_t m, std::function< bool(const char *, const char *)> fn)
bool split_find (const char *b, const char *e, char d, std::function< bool(const char *, const char *)> fn)
template<typename T>
ssize_t handle_EINTR (T fn)
int poll_wrapper (struct pollfd *fds, nfds_t nfds, int timeout)
template<bool Read>
ssize_t select_impl (socket_t sock, time_t sec, time_t usec)
ssize_t select_read (socket_t sock, time_t sec, time_t usec)
ssize_t select_write (socket_t sock, time_t sec, time_t usec)
Error wait_until_socket_is_ready (socket_t sock, time_t sec, time_t usec)
bool is_socket_alive (socket_t sock)
bool keep_alive (const std::atomic< socket_t > &svr_sock, socket_t sock, time_t keep_alive_timeout_sec)
template<typename T>
bool process_server_socket_core (const std::atomic< socket_t > &svr_sock, socket_t sock, size_t keep_alive_max_count, time_t keep_alive_timeout_sec, T callback)
template<typename T>
bool process_server_socket (const std::atomic< socket_t > &svr_sock, socket_t sock, size_t keep_alive_max_count, time_t keep_alive_timeout_sec, time_t read_timeout_sec, time_t read_timeout_usec, time_t write_timeout_sec, time_t write_timeout_usec, T callback)
int shutdown_socket (socket_t sock)
std::string escape_abstract_namespace_unix_domain (const std::string &s)
std::string unescape_abstract_namespace_unix_domain (const std::string &s)
int getaddrinfo_with_timeout (const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res, time_t timeout_sec)
template<typename BindOrConnect>
socket_t create_socket (const std::string &host, const std::string &ip, int port, int address_family, int socket_flags, bool tcp_nodelay, bool ipv6_v6only, SocketOptions socket_options, BindOrConnect bind_or_connect, time_t timeout_sec=0)
void set_nonblocking (socket_t sock, bool nonblocking)
bool is_connection_error ()
bool bind_ip_address (socket_t sock, const std::string &host)
std::string if2ip (int address_family, const std::string &ifn)
bool get_ip_and_port (const struct sockaddr_storage &addr, socklen_t addr_len, std::string &ip, int &port)
void get_local_ip_and_port (socket_t sock, std::string &ip, int &port)
void get_remote_ip_and_port (socket_t sock, std::string &ip, int &port)
constexpr unsigned int str2tag_core (const char *s, size_t l, unsigned int h)
unsigned int str2tag (const std::string &s)
std::string find_content_type (const std::string &path, const std::map< std::string, std::string > &user_data, const std::string &default_content_type)
bool can_compress_content_type (const std::string &content_type)
std::unique_ptr< decompressor > create_decompressor (const std::string &encoding)
bool is_prohibited_header_name (const std::string &name)
bool has_header (const Headers &headers, const std::string &key)
bool read_headers (Stream &strm, Headers &headers)
bool read_content_with_length (Stream &strm, size_t len, DownloadProgress progress, ContentReceiverWithProgress out)
void skip_content_with_length (Stream &strm, size_t len)
ReadContentResult read_content_without_length (Stream &strm, size_t payload_max_length, ContentReceiverWithProgress out)
template<typename T>
ReadContentResult read_content_chunked (Stream &strm, T &x, size_t payload_max_length, ContentReceiverWithProgress out)
bool is_chunked_transfer_encoding (const Headers &headers)
template<typename T, typename U>
bool prepare_content_receiver (T &x, int &status, ContentReceiverWithProgress receiver, bool decompress, U callback)
template<typename T>
bool read_content (Stream &strm, T &x, size_t payload_max_length, int &status, DownloadProgress progress, ContentReceiverWithProgress receiver, bool decompress)
ssize_t write_request_line (Stream &strm, const std::string &method, const std::string &path)
ssize_t write_response_line (Stream &strm, int status)
bool write_data (Stream &strm, const char *d, size_t l)
template<typename T>
bool write_content_with_progress (Stream &strm, const ContentProvider &content_provider, size_t offset, size_t length, T is_shutting_down, const UploadProgress &upload_progress, Error &error)
template<typename T>
bool write_content (Stream &strm, const ContentProvider &content_provider, size_t offset, size_t length, T is_shutting_down, Error &error)
template<typename T>
bool write_content (Stream &strm, const ContentProvider &content_provider, size_t offset, size_t length, const T &is_shutting_down)
template<typename T>
bool write_content_without_length (Stream &strm, const ContentProvider &content_provider, const T &is_shutting_down)
template<typename T, typename U>
bool write_content_chunked (Stream &strm, const ContentProvider &content_provider, const T &is_shutting_down, U &compressor, Error &error)
template<typename T, typename U>
bool write_content_chunked (Stream &strm, const ContentProvider &content_provider, const T &is_shutting_down, U &compressor)
template<typename T>
bool redirect (T &cli, Request &req, Response &res, const std::string &path, const std::string &location, Error &error)
std::string normalize_query_string (const std::string &query)
void parse_disposition_params (const std::string &s, Params &params)
std::string random_string (size_t length)
std::string make_multipart_data_boundary ()
bool is_multipart_boundary_chars_valid (const std::string &boundary)
template<typename T>
std::string serialize_multipart_formdata_item_begin (const T &item, const std::string &boundary)
std::string serialize_multipart_formdata_item_end ()
std::string serialize_multipart_formdata_finish (const std::string &boundary)
std::string serialize_multipart_formdata_get_content_type (const std::string &boundary)
std::string serialize_multipart_formdata (const UploadFormDataItems &items, const std::string &boundary, bool finish=true)
void coalesce_ranges (Ranges &ranges, size_t content_length)
bool range_error (Request &req, Response &res)
std::pair< size_t, size_t > get_range_offset_and_length (Range r, size_t content_length)
std::string make_content_range_header_field (const std::pair< size_t, size_t > &offset_and_length, size_t content_length)
template<typename SToken, typename CToken, typename Content>
bool process_multipart_ranges_data (const Request &req, const std::string &boundary, const std::string &content_type, size_t content_length, SToken stoken, CToken ctoken, Content content)
void make_multipart_ranges_data (const Request &req, Response &res, const std::string &boundary, const std::string &content_type, size_t content_length, std::string &data)
size_t get_multipart_ranges_data_length (const Request &req, const std::string &boundary, const std::string &content_type, size_t content_length)
template<typename T>
bool write_multipart_ranges_data (Stream &strm, const Request &req, Response &res, const std::string &boundary, const std::string &content_type, size_t content_length, const T &is_shutting_down)
bool expect_content (const Request &req)
bool has_crlf (const std::string &s)
bool parse_www_authenticate (const Response &res, std::map< std::string, std::string > &auth, bool is_proxy)
void calc_actual_timeout (time_t max_timeout_msec, time_t duration_msec, time_t timeout_sec, time_t timeout_usec, time_t &actual_timeout_sec, time_t &actual_timeout_usec)
std::string prepare_host_string (const std::string &host)
std::string make_host_and_port_string_always_port (const std::string &host, int port)

Enumeration Type Documentation

◆ EncodingType

enum class httplib::detail::EncodingType
strong
Enumerator
None 
Gzip 
Brotli 
Zstd 

Definition at line 2853 of file httplib.h.

◆ ReadContentResult

Enumerator
Success 
PayloadTooLarge 
Error 

Definition at line 6928 of file httplib.h.

Function Documentation

◆ base64_encode()

std::string httplib::detail::base64_encode ( const std::string & in)
inline

Definition at line 4150 of file httplib.h.

◆ bind_ip_address()

bool httplib::detail::bind_ip_address ( socket_t sock,
const std::string & host )
inline

Definition at line 5926 of file httplib.h.

◆ calc_actual_timeout()

void httplib::detail::calc_actual_timeout ( time_t max_timeout_msec,
time_t duration_msec,
time_t timeout_sec,
time_t timeout_usec,
time_t & actual_timeout_sec,
time_t & actual_timeout_usec )
inline

Definition at line 10190 of file httplib.h.

◆ can_compress_content_type()

bool httplib::detail::can_compress_content_type ( const std::string & content_type)
inline

Definition at line 6303 of file httplib.h.

◆ close_socket()

int httplib::detail::close_socket ( socket_t sock)
inline

Definition at line 4924 of file httplib.h.

◆ coalesce_ranges()

void httplib::detail::coalesce_ranges ( Ranges & ranges,
size_t content_length )
inline

Definition at line 8368 of file httplib.h.

◆ compute_etag()

std::string httplib::detail::compute_etag ( const FileStat & fs)
inline

Definition at line 3995 of file httplib.h.

◆ create_client_socket()

socket_t httplib::detail::create_client_socket ( const std::string & host,
const std::string & ip,
int port,
int address_family,
bool tcp_nodelay,
bool ipv6_v6only,
SocketOptions socket_options,
time_t connection_timeout_sec,
time_t connection_timeout_usec,
time_t read_timeout_sec,
time_t read_timeout_usec,
time_t write_timeout_sec,
time_t write_timeout_usec,
const std::string & intf,
Error & error )
inline

Definition at line 6011 of file httplib.h.

◆ create_decompressor()

std::unique_ptr< decompressor > httplib::detail::create_decompressor ( const std::string & encoding)
inline

Definition at line 6727 of file httplib.h.

◆ create_socket()

template<typename BindOrConnect>
socket_t httplib::detail::create_socket ( const std::string & host,
const std::string & ip,
int port,
int address_family,
int socket_flags,
bool tcp_nodelay,
bool ipv6_v6only,
SocketOptions socket_options,
BindOrConnect bind_or_connect,
time_t timeout_sec = 0 )

Definition at line 5725 of file httplib.h.

◆ divide() [1/2]

void httplib::detail::divide ( const char * data,
std::size_t size,
char d,
std::function< void(const char *, std::size_t, const char *, std::size_t)> fn )
inline

Definition at line 4557 of file httplib.h.

◆ divide() [2/2]

void httplib::detail::divide ( const std::string & str,
char d,
std::function< void(const char *, std::size_t, const char *, std::size_t)> fn )
inline

Definition at line 4572 of file httplib.h.

◆ duration_to_sec_and_usec()

template<typename T, typename U>
void httplib::detail::duration_to_sec_and_usec ( const T & duration,
U callback )
inline

Definition at line 2477 of file httplib.h.

◆ encode_path()

std::string httplib::detail::encode_path ( const std::string & s)
inline

Definition at line 4272 of file httplib.h.

◆ encoding_type()

EncodingType httplib::detail::encoding_type ( const Request & req,
const Response & res )
inline

Definition at line 6327 of file httplib.h.

◆ escape_abstract_namespace_unix_domain()

std::string httplib::detail::escape_abstract_namespace_unix_domain ( const std::string & s)
inline

Definition at line 5299 of file httplib.h.

◆ expect_content()

bool httplib::detail::expect_content ( const Request & req)
inline

Definition at line 8659 of file httplib.h.

◆ file_extension()

std::string httplib::detail::file_extension ( const std::string & path)
inline

Definition at line 4324 of file httplib.h.

◆ file_mtime_to_http_date()

std::string httplib::detail::file_mtime_to_http_date ( time_t mtime)
inline

Definition at line 4022 of file httplib.h.

◆ find_content_type()

std::string httplib::detail::find_content_type ( const std::string & path,
const std::map< std::string, std::string > & user_data,
const std::string & default_content_type )
inline

Definition at line 6192 of file httplib.h.

◆ from_hex_to_i()

bool httplib::detail::from_hex_to_i ( const std::string & s,
size_t i,
size_t cnt,
int & val )
inline

Definition at line 3954 of file httplib.h.

◆ from_i_to_hex()

std::string httplib::detail::from_i_to_hex ( size_t n)
inline

Definition at line 3982 of file httplib.h.

◆ get_header_value()

const char * httplib::detail::get_header_value ( const Headers & headers,
const std::string & key,
const char * def,
size_t id )
inline

Definition at line 6778 of file httplib.h.

◆ get_header_value_u64() [1/2]

size_t httplib::detail::get_header_value_u64 ( const Headers & headers,
const std::string & key,
size_t def,
size_t id )
inline

Definition at line 2523 of file httplib.h.

◆ get_header_value_u64() [2/2]

size_t httplib::detail::get_header_value_u64 ( const Headers & headers,
const std::string & key,
size_t def,
size_t id,
bool & is_invalid_value )
inline

Definition at line 2501 of file httplib.h.

◆ get_ip_and_port()

bool httplib::detail::get_ip_and_port ( const struct sockaddr_storage & addr,
socklen_t addr_len,
std::string & ip,
int & port )
inline

Definition at line 6090 of file httplib.h.

◆ get_local_ip_and_port()

void httplib::detail::get_local_ip_and_port ( socket_t sock,
std::string & ip,
int & port )
inline

Definition at line 6119 of file httplib.h.

◆ get_multipart_ranges_data_length()

size_t httplib::detail::get_multipart_ranges_data_length ( const Request & req,
const std::string & boundary,
const std::string & content_type,
size_t content_length )
inline

Definition at line 8609 of file httplib.h.

◆ get_range_offset_and_length()

std::pair< size_t, size_t > httplib::detail::get_range_offset_and_length ( Range r,
size_t content_length )
inline

Definition at line 8519 of file httplib.h.

◆ get_remote_ip_and_port()

void httplib::detail::get_remote_ip_and_port ( socket_t sock,
std::string & ip,
int & port )
inline

Definition at line 6130 of file httplib.h.

◆ getaddrinfo_with_timeout()

int httplib::detail::getaddrinfo_with_timeout ( const char * node,
const char * service,
const struct addrinfo * hints,
struct addrinfo ** res,
time_t timeout_sec )
inline

Definition at line 5322 of file httplib.h.

◆ handle_EINTR()

template<typename T>
ssize_t httplib::detail::handle_EINTR ( T fn)
inline

Definition at line 4933 of file httplib.h.

◆ has_crlf()

bool httplib::detail::has_crlf ( const std::string & s)
inline

Definition at line 8678 of file httplib.h.

◆ has_header()

bool httplib::detail::has_header ( const Headers & headers,
const std::string & key )
inline

Definition at line 6769 of file httplib.h.

◆ if2ip()

std::string httplib::detail::if2ip ( int address_family,
const std::string & ifn )
inline

Definition at line 5962 of file httplib.h.

◆ is_chunked_transfer_encoding()

bool httplib::detail::is_chunked_transfer_encoding ( const Headers & headers)
inline

Definition at line 7014 of file httplib.h.

◆ is_connection_error()

bool httplib::detail::is_connection_error ( )
inline

Definition at line 5917 of file httplib.h.

◆ is_hex()

bool httplib::detail::is_hex ( char c,
int & v )
inline

Definition at line 3934 of file httplib.h.

◆ is_multipart_boundary_chars_valid()

bool httplib::detail::is_multipart_boundary_chars_valid ( const std::string & boundary)
inline

Definition at line 8295 of file httplib.h.

◆ is_numeric()

bool httplib::detail::is_numeric ( const std::string & str)
inline

Definition at line 2491 of file httplib.h.

◆ is_prohibited_header_name()

bool httplib::detail::is_prohibited_header_name ( const std::string & name)
inline

Definition at line 6753 of file httplib.h.

◆ is_socket_alive()

bool httplib::detail::is_socket_alive ( socket_t sock)
inline

Definition at line 5106 of file httplib.h.

◆ is_space_or_tab()

bool httplib::detail::is_space_or_tab ( char c)
inline

Definition at line 4335 of file httplib.h.

◆ is_strong_etag()

bool httplib::detail::is_strong_etag ( const std::string & s)
inline

Definition at line 4097 of file httplib.h.

◆ is_valid_path()

bool httplib::detail::is_valid_path ( const std::string & path)
inline

Definition at line 4185 of file httplib.h.

◆ is_weak_etag()

bool httplib::detail::is_weak_etag ( const std::string & s)
inline

Definition at line 4091 of file httplib.h.

◆ keep_alive()

bool httplib::detail::keep_alive ( const std::atomic< socket_t > & svr_sock,
socket_t sock,
time_t keep_alive_timeout_sec )
inline

Definition at line 5191 of file httplib.h.

◆ make_content_range_header_field()

std::string httplib::detail::make_content_range_header_field ( const std::pair< size_t, size_t > & offset_and_length,
size_t content_length )
inline

Definition at line 8529 of file httplib.h.

◆ make_host_and_port_string()

std::string httplib::detail::make_host_and_port_string ( const std::string & host,
int port,
bool is_ssl )
inline

Definition at line 10561 of file httplib.h.

◆ make_host_and_port_string_always_port()

std::string httplib::detail::make_host_and_port_string_always_port ( const std::string & host,
int port )
inline

Definition at line 10581 of file httplib.h.

◆ make_multipart_data_boundary()

std::string httplib::detail::make_multipart_data_boundary ( )
inline

Definition at line 8290 of file httplib.h.

◆ make_multipart_ranges_data()

void httplib::detail::make_multipart_ranges_data ( const Request & req,
Response & res,
const std::string & boundary,
const std::string & content_type,
size_t content_length,
std::string & data )
inline

Definition at line 8585 of file httplib.h.

◆ make_unique() [1/2]

template<class T, class... Args>
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type httplib::detail::make_unique ( Args &&... args)

Definition at line 396 of file httplib.h.

◆ make_unique() [2/2]

template<class T>
std::enable_if< std::is_array< T >::value, std::unique_ptr< T > >::type httplib::detail::make_unique ( std::size_t n)

Definition at line 403 of file httplib.h.

◆ normalize_query_string()

std::string httplib::detail::normalize_query_string ( const std::string & query)
inline

Definition at line 7581 of file httplib.h.

◆ params_to_query_str()

std::string httplib::detail::params_to_query_str ( const Params & params)
inline

Definition at line 7525 of file httplib.h.

◆ parse_accept_header()

bool httplib::detail::parse_accept_header ( const std::string & s,
std::vector< std::string > & content_types )
inline

Definition at line 7735 of file httplib.h.

◆ parse_disposition_params()

void httplib::detail::parse_disposition_params ( const std::string & s,
Params & params )
inline

Definition at line 7632 of file httplib.h.

◆ parse_header()

template<typename T>
bool httplib::detail::parse_header ( const char * beg,
const char * end,
T fn )
inline

Definition at line 4344 of file httplib.h.

◆ parse_http_date()

time_t httplib::detail::parse_http_date ( const std::string & date_str)
inline

Definition at line 4051 of file httplib.h.

◆ parse_multipart_boundary()

bool httplib::detail::parse_multipart_boundary ( const std::string & content_type,
std::string & boundary )
inline

Definition at line 7617 of file httplib.h.

◆ parse_query_text() [1/2]

void httplib::detail::parse_query_text ( const char * data,
std::size_t size,
Params & params )
inline

Definition at line 7542 of file httplib.h.

◆ parse_query_text() [2/2]

void httplib::detail::parse_query_text ( const std::string & s,
Params & params )
inline

Definition at line 7572 of file httplib.h.

◆ parse_range_header()

bool httplib::detail::parse_range_header ( const std::string & s,
Ranges & ranges )
inline

Definition at line 7670 of file httplib.h.

◆ parse_trailers()

bool httplib::detail::parse_trailers ( stream_line_reader & line_reader,
Headers & dest,
const Headers & src_headers )
inline

Definition at line 4413 of file httplib.h.

◆ parse_www_authenticate()

bool httplib::detail::parse_www_authenticate ( const Response & res,
std::map< std::string, std::string > & auth,
bool is_proxy )
inline

Definition at line 8986 of file httplib.h.

◆ poll_wrapper()

int httplib::detail::poll_wrapper ( struct pollfd * fds,
nfds_t nfds,
int timeout )
inline

Definition at line 4978 of file httplib.h.

◆ prepare_content_receiver()

template<typename T, typename U>
bool httplib::detail::prepare_content_receiver ( T & x,
int & status,
ContentReceiverWithProgress receiver,
bool decompress,
U callback )

Definition at line 7021 of file httplib.h.

◆ prepare_host_string()

std::string httplib::detail::prepare_host_string ( const std::string & host)
inline

Definition at line 10545 of file httplib.h.

◆ process_client_socket()

bool httplib::detail::process_client_socket ( socket_t sock,
time_t read_timeout_sec,
time_t read_timeout_usec,
time_t write_timeout_sec,
time_t write_timeout_usec,
time_t max_timeout_msec,
std::chrono::time_point< std::chrono::steady_clock > start_time,
std::function< bool(Stream &)> callback )
inline

Definition at line 5277 of file httplib.h.

◆ process_multipart_ranges_data()

template<typename SToken, typename CToken, typename Content>
bool httplib::detail::process_multipart_ranges_data ( const Request & req,
const std::string & boundary,
const std::string & content_type,
size_t content_length,
SToken stoken,
CToken ctoken,
Content content )

Definition at line 8545 of file httplib.h.

◆ process_server_socket()

template<typename T>
bool httplib::detail::process_server_socket ( const std::atomic< socket_t > & svr_sock,
socket_t sock,
size_t keep_alive_max_count,
time_t keep_alive_timeout_sec,
time_t read_timeout_sec,
time_t read_timeout_usec,
time_t write_timeout_sec,
time_t write_timeout_usec,
T callback )
inline

Definition at line 5261 of file httplib.h.

◆ process_server_socket_core()

template<typename T>
bool httplib::detail::process_server_socket_core ( const std::atomic< socket_t > & svr_sock,
socket_t sock,
size_t keep_alive_max_count,
time_t keep_alive_timeout_sec,
T callback )
inline

Definition at line 5238 of file httplib.h.

◆ random_string()

std::string httplib::detail::random_string ( size_t length)
inline

Definition at line 8265 of file httplib.h.

◆ range_error()

bool httplib::detail::range_error ( Request & req,
Response & res )
inline

Definition at line 8435 of file httplib.h.

◆ read_body_content()

ssize_t httplib::detail::read_body_content ( Stream * stream,
BodyReader & br,
char * buf,
size_t len )
inline

Definition at line 1593 of file httplib.h.

◆ read_content()

template<typename T>
bool httplib::detail::read_content ( Stream & strm,
T & x,
size_t payload_max_length,
int & status,
DownloadProgress progress,
ContentReceiverWithProgress receiver,
bool decompress )

Definition at line 7073 of file httplib.h.

◆ read_content_chunked()

template<typename T>
ReadContentResult httplib::detail::read_content_chunked ( Stream & strm,
T & x,
size_t payload_max_length,
ContentReceiverWithProgress out )
inline

Definition at line 6971 of file httplib.h.

◆ read_content_with_length()

bool httplib::detail::read_content_with_length ( Stream & strm,
size_t len,
DownloadProgress progress,
ContentReceiverWithProgress out )
inline

Definition at line 6870 of file httplib.h.

◆ read_content_without_length()

ReadContentResult httplib::detail::read_content_without_length ( Stream & strm,
size_t payload_max_length,
ContentReceiverWithProgress out )
inline

Definition at line 6936 of file httplib.h.

◆ read_headers()

bool httplib::detail::read_headers ( Stream & strm,
Headers & headers )
inline

Definition at line 6802 of file httplib.h.

◆ read_socket()

ssize_t httplib::detail::read_socket ( socket_t sock,
void * ptr,
size_t size,
int flags )
inline

Definition at line 4949 of file httplib.h.

◆ redirect()

template<typename T>
bool httplib::detail::redirect ( T & cli,
Request & req,
Response & res,
const std::string & path,
const std::string & location,
Error & error )
inline

Definition at line 7493 of file httplib.h.

◆ select_impl()

template<bool Read>
ssize_t httplib::detail::select_impl ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 4988 of file httplib.h.

◆ select_read()

ssize_t httplib::detail::select_read ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 5024 of file httplib.h.

◆ select_write()

ssize_t httplib::detail::select_write ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 5029 of file httplib.h.

◆ send_socket()

ssize_t httplib::detail::send_socket ( socket_t sock,
const void * ptr,
size_t size,
int flags )
inline

Definition at line 4963 of file httplib.h.

◆ serialize_multipart_formdata()

std::string httplib::detail::serialize_multipart_formdata ( const UploadFormDataItems & items,
const std::string & boundary,
bool finish = true )
inline

Definition at line 8349 of file httplib.h.

◆ serialize_multipart_formdata_finish()

std::string httplib::detail::serialize_multipart_formdata_finish ( const std::string & boundary)
inline

Definition at line 8337 of file httplib.h.

◆ serialize_multipart_formdata_get_content_type()

std::string httplib::detail::serialize_multipart_formdata_get_content_type ( const std::string & boundary)
inline

Definition at line 8343 of file httplib.h.

◆ serialize_multipart_formdata_item_begin()

template<typename T>
std::string httplib::detail::serialize_multipart_formdata_item_begin ( const T & item,
const std::string & boundary )
inline

Definition at line 8312 of file httplib.h.

◆ serialize_multipart_formdata_item_end()

std::string httplib::detail::serialize_multipart_formdata_item_end ( )
inline

Definition at line 8331 of file httplib.h.

◆ set_nonblocking()

void httplib::detail::set_nonblocking ( socket_t sock,
bool nonblocking )
inline

Definition at line 5905 of file httplib.h.

◆ set_socket_opt()

bool httplib::detail::set_socket_opt ( socket_t sock,
int level,
int optname,
int optval )
inline

Definition at line 2560 of file httplib.h.

◆ set_socket_opt_impl()

bool httplib::detail::set_socket_opt_impl ( socket_t sock,
int level,
int optname,
const void * optval,
socklen_t optlen )
inline

Definition at line 2548 of file httplib.h.

◆ set_socket_opt_time()

bool httplib::detail::set_socket_opt_time ( socket_t sock,
int level,
int optname,
time_t sec,
time_t usec )
inline

Definition at line 2565 of file httplib.h.

◆ shutdown_socket()

int httplib::detail::shutdown_socket ( socket_t sock)
inline

Definition at line 5290 of file httplib.h.

◆ skip_content_with_length()

void httplib::detail::skip_content_with_length ( Stream & strm,
size_t len )
inline

Definition at line 6912 of file httplib.h.

◆ split() [1/2]

void httplib::detail::split ( const char * b,
const char * e,
char d,
size_t m,
std::function< void(const char *, const char *)> fn )
inline

Definition at line 4585 of file httplib.h.

◆ split() [2/2]

void httplib::detail::split ( const char * b,
const char * e,
char d,
std::function< void(const char *, const char *)> fn )
inline

Definition at line 4579 of file httplib.h.

◆ split_find() [1/2]

bool httplib::detail::split_find ( const char * b,
const char * e,
char d,
size_t m,
std::function< bool(const char *, const char *)> fn )
inline

Definition at line 4617 of file httplib.h.

◆ split_find() [2/2]

bool httplib::detail::split_find ( const char * b,
const char * e,
char d,
std::function< bool(const char *, const char *)> fn )
inline

Definition at line 4659 of file httplib.h.

◆ str2tag()

unsigned int httplib::detail::str2tag ( const std::string & s)
inline

Definition at line 6176 of file httplib.h.

◆ str2tag_core()

unsigned int httplib::detail::str2tag_core ( const char * s,
size_t l,
unsigned int h )
inlineconstexpr

Definition at line 6163 of file httplib.h.

◆ str_len()

template<size_t N>
size_t httplib::detail::str_len ( const char(&)[N])
inlineconstexpr

Definition at line 2486 of file httplib.h.

◆ to_utf8()

size_t httplib::detail::to_utf8 ( int code,
char * buff )
inline

Definition at line 4104 of file httplib.h.

◆ trim()

std::pair< size_t, size_t > httplib::detail::trim ( const char * b,
const char * e,
size_t left,
size_t right )
inline

Definition at line 4527 of file httplib.h.

◆ trim_copy()

std::string httplib::detail::trim_copy ( const std::string & s)
inline

Definition at line 4541 of file httplib.h.

◆ trim_double_quotes_copy()

std::string httplib::detail::trim_double_quotes_copy ( const std::string & s)
inline

Definition at line 4547 of file httplib.h.

◆ unescape_abstract_namespace_unix_domain()

std::string httplib::detail::unescape_abstract_namespace_unix_domain ( const std::string & s)
inline

Definition at line 5311 of file httplib.h.

◆ wait_until_socket_is_ready()

Error httplib::detail::wait_until_socket_is_ready ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 5034 of file httplib.h.

◆ write_content() [1/2]

template<typename T>
bool httplib::detail::write_content ( Stream & strm,
const ContentProvider & content_provider,
size_t offset,
size_t length,
const T & is_shutting_down )
inline

Definition at line 7287 of file httplib.h.

◆ write_content() [2/2]

template<typename T>
bool httplib::detail::write_content ( Stream & strm,
const ContentProvider & content_provider,
size_t offset,
size_t length,
T is_shutting_down,
Error & error )
inline

Definition at line 7278 of file httplib.h.

◆ write_content_chunked() [1/2]

template<typename T, typename U>
bool httplib::detail::write_content_chunked ( Stream & strm,
const ContentProvider & content_provider,
const T & is_shutting_down,
U & compressor )
inline

Definition at line 7483 of file httplib.h.

◆ write_content_chunked() [2/2]

template<typename T, typename U>
bool httplib::detail::write_content_chunked ( Stream & strm,
const ContentProvider & content_provider,
const T & is_shutting_down,
U & compressor,
Error & error )
inline

Definition at line 7347 of file httplib.h.

◆ write_content_with_progress()

template<typename T>
bool httplib::detail::write_content_with_progress ( Stream & strm,
const ContentProvider & content_provider,
size_t offset,
size_t length,
T is_shutting_down,
const UploadProgress & upload_progress,
Error & error )
inline

Definition at line 7214 of file httplib.h.

◆ write_content_without_length()

template<typename T>
bool httplib::detail::write_content_without_length ( Stream & strm,
const ContentProvider & content_provider,
const T & is_shutting_down )
inline

Definition at line 7298 of file httplib.h.

◆ write_data()

bool httplib::detail::write_data ( Stream & strm,
const char * d,
size_t l )
inline

Definition at line 7198 of file httplib.h.

◆ write_headers()

ssize_t httplib::detail::write_headers ( Stream & strm,
const Headers & headers )
inline

Definition at line 7171 of file httplib.h.

◆ write_multipart_ranges_data()

template<typename T>
bool httplib::detail::write_multipart_ranges_data ( Stream & strm,
const Request & req,
Response & res,
const std::string & boundary,
const std::string & content_type,
size_t content_length,
const T & is_shutting_down )
inline

Definition at line 8637 of file httplib.h.

◆ write_request_line()

ssize_t httplib::detail::write_request_line ( Stream & strm,
const std::string & method,
const std::string & path )
inline

Definition at line 7151 of file httplib.h.

◆ write_response_line()

ssize_t httplib::detail::write_response_line ( Stream & strm,
int status )
inline

Definition at line 7161 of file httplib.h.