httplib::detail Namespace Reference

Namespaces

namespace  case_ignore
 
namespace  udl
 

Classes

class  BufferStream
 
class  compressor
 
class  ContentProviderAdapter
 
class  decompressor
 
struct  FileStat
 
class  MatcherBase
 
class  mmap
 
class  MultipartFormDataParser
 
class  nocompressor
 
class  PathParamsMatcher
 Captures parameters in request path and stores them in Request::path_params. More...
 
class  RegexMatcher
 Performs std::regex_match on request path and stores the result in Request::matches. More...
 
struct  scope_exit
 
class  SocketStream
 
class  stream_line_reader
 

Enumerations

enum class  EncodingType { None = 0 , Gzip , Brotli }
 

Functions

std::string base64_encode (const std::string &in)
 
bool bind_ip_address (socket_t sock, const std::string &host)
 
bool can_compress_content_type (const std::string &content_type)
 
int close_socket (socket_t sock)
 
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)
 
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)
 
std::string decode_url (const std::string &s, bool convert_plus_to_space)
 
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)
 
template<typename T, typename U>
void duration_to_sec_and_usec (const T &duration, U callback)
 
std::string encode_query_param (const std::string &value)
 
std::string encode_url (const std::string &s)
 
EncodingType encoding_type (const Request &req, const Response &res)
 
std::string escape_abstract_namespace_unix_domain (const std::string &s)
 
bool expect_content (const Request &req)
 
std::string file_extension (const std::string &path)
 
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 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)
 
const char * get_header_value (const Headers &headers, const std::string &key, const char *def, size_t id)
 
uint64_t get_header_value_u64 (const Headers &headers, const std::string &key, uint64_t def, size_t id)
 
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)
 
size_t get_multipart_ranges_data_length (const Request &req, const std::string &boundary, const std::string &content_type, size_t content_length)
 
std::pair< size_t, size_t > get_range_offset_and_length (Range r, size_t content_length)
 
void get_remote_ip_and_port (socket_t sock, std::string &ip, int &port)
 
template<typename T>
ssize_t handle_EINTR (T fn)
 
bool has_crlf (const std::string &s)
 
bool has_header (const Headers &headers, const std::string &key)
 
std::string if2ip (int address_family, const std::string &ifn)
 
bool is_chunked_transfer_encoding (const Headers &headers)
 
bool is_connection_error ()
 
bool is_hex (char c, int &v)
 
bool is_multipart_boundary_chars_valid (const std::string &boundary)
 
bool is_socket_alive (socket_t sock)
 
bool is_space_or_tab (char c)
 
bool is_valid_path (const std::string &path)
 
bool keep_alive (const std::atomic< socket_t > &svr_sock, socket_t sock, time_t keep_alive_timeout_sec)
 
std::string make_content_range_header_field (const std::pair< size_t, size_t > &offset_and_length, size_t content_length)
 
std::string make_multipart_data_boundary ()
 
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)
 
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)
 
std::string params_to_query_str (const Params &params)
 
void parse_disposition_params (const std::string &s, Params &params)
 
template<typename T>
bool parse_header (const char *beg, const char *end, T fn)
 
bool parse_multipart_boundary (const std::string &content_type, std::string &boundary)
 
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_range_header (const std::string &s, Ranges &ranges)
 
bool parse_www_authenticate (const Response &res, std::map< std::string, std::string > &auth, bool is_proxy)
 
template<typename T, typename U>
bool prepare_content_receiver (T &x, int &status, ContentReceiverWithProgress receiver, bool decompress, U callback)
 
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, std::function< bool(Stream &)> callback)
 
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)
 
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)
 
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)
 
std::string random_string (size_t length)
 
bool range_error (Request &req, Response &res)
 
template<typename T>
bool read_content (Stream &strm, T &x, size_t payload_max_length, int &status, Progress progress, ContentReceiverWithProgress receiver, bool decompress)
 
template<typename T>
bool read_content_chunked (Stream &strm, T &x, ContentReceiverWithProgress out)
 
bool read_content_with_length (Stream &strm, uint64_t len, Progress progress, ContentReceiverWithProgress out)
 
bool read_content_without_length (Stream &strm, ContentReceiverWithProgress out)
 
void read_file (const std::string &path, std::string &out)
 
bool read_headers (Stream &strm, Headers &headers)
 
ssize_t read_socket (socket_t sock, void *ptr, size_t size, int flags)
 
template<typename T>
bool redirect (T &cli, Request &req, Response &res, const std::string &path, const std::string &location, Error &error)
 
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)
 
ssize_t send_socket (socket_t sock, const void *ptr, size_t size, int flags)
 
std::string serialize_multipart_formdata (const MultipartFormDataItems &items, const std::string &boundary, bool finish=true)
 
std::string serialize_multipart_formdata_finish (const std::string &boundary)
 
std::string serialize_multipart_formdata_get_content_type (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 ()
 
void set_nonblocking (socket_t sock, bool nonblocking)
 
int shutdown_socket (socket_t sock)
 
void skip_content_with_length (Stream &strm, uint64_t len)
 
void split (const char *b, const char *e, char d, size_t m, std::function< void(const char *, const char *)> fn)
 
void split (const char *b, const char *e, char d, std::function< void(const char *, const char *)> fn)
 
unsigned int str2tag (const std::string &s)
 
constexpr unsigned int str2tag_core (const char *s, size_t l, unsigned int h)
 
size_t to_utf8 (int code, char *buff)
 
std::pair< size_t, size_t > trim (const char *b, const char *e, size_t left, size_t right)
 
std::string trim_copy (const std::string &s)
 
std::string trim_double_quotes_copy (const std::string &s)
 
std::string unescape_abstract_namespace_unix_domain (const std::string &s)
 
Error wait_until_socket_is_ready (socket_t sock, time_t sec, time_t usec)
 
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 (Stream &strm, const ContentProvider &content_provider, size_t offset, size_t length, T is_shutting_down, 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, typename U>
bool write_content_chunked (Stream &strm, const ContentProvider &content_provider, const T &is_shutting_down, U &compressor, Error &error)
 
template<typename T>
bool write_content_without_length (Stream &strm, const ContentProvider &content_provider, const T &is_shutting_down)
 
bool write_data (Stream &strm, const char *d, size_t l)
 
ssize_t write_headers (Stream &strm, const Headers &headers)
 
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)
 
ssize_t write_request_line (Stream &strm, const std::string &method, const std::string &path)
 
ssize_t write_response_line (Stream &strm, int status)
 

Enumeration Type Documentation

◆ EncodingType

enum class EncodingType
strong
Enumerator
None 
Gzip 
Brotli 

Definition at line 2353 of file httplib.h.

Function Documentation

◆ base64_encode()

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

Definition at line 2594 of file httplib.h.

+ Here is the caller graph for this function:

◆ bind_ip_address()

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

Definition at line 3558 of file httplib.h.

+ Here is the caller graph for this function:

◆ can_compress_content_type()

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

Definition at line 3858 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_socket()

int close_socket ( socket_t sock)
inline

Definition at line 3059 of file httplib.h.

+ Here is the caller graph for this function:

◆ create_client_socket()

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 )
inline

Definition at line 3624 of file httplib.h.

+ Here is the call graph for this function:

◆ create_socket()

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 )

Definition at line 3388 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decode_url()

std::string decode_url ( const std::string & s,
bool convert_plus_to_space )
inline

Definition at line 2732 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ divide() [1/2]

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 )
inline

Definition at line 2811 of file httplib.h.

+ Here is the caller graph for this function:

◆ divide() [2/2]

void 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 2825 of file httplib.h.

+ Here is the call graph for this function:

◆ duration_to_sec_and_usec()

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

Definition at line 2007 of file httplib.h.

+ Here is the caller graph for this function:

◆ encode_query_param()

std::string encode_query_param ( const std::string & value)
inline

Definition at line 2679 of file httplib.h.

+ Here is the caller graph for this function:

◆ encode_url()

std::string encode_url ( const std::string & s)
inline

Definition at line 2700 of file httplib.h.

◆ encoding_type()

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

Definition at line 3877 of file httplib.h.

+ Here is the call graph for this function:

◆ escape_abstract_namespace_unix_domain()

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

Definition at line 3368 of file httplib.h.

◆ expect_content()

bool expect_content ( const Request & req)
inline

Definition at line 5295 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ file_extension()

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

Definition at line 2778 of file httplib.h.

+ Here is the caller graph for this function:

◆ find_content_type()

std::string 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 3793 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ from_hex_to_i()

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

Definition at line 2533 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ from_i_to_hex()

std::string from_i_to_hex ( size_t n)
inline

Definition at line 2550 of file httplib.h.

+ Here is the caller graph for this function:

◆ get_header_value()

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

Definition at line 4109 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_header_value_u64()

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

Definition at line 2015 of file httplib.h.

+ Here is the caller graph for this function:

◆ get_ip_and_port()

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

Definition at line 3709 of file httplib.h.

+ Here is the caller graph for this function:

◆ get_local_ip_and_port()

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

Definition at line 3731 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_multipart_ranges_data_length()

size_t 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 5261 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_range_offset_and_length()

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

Definition at line 5185 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_remote_ip_and_port()

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

Definition at line 3740 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle_EINTR()

template<typename T>
ssize_t handle_EINTR ( T fn)
inline

Definition at line 3067 of file httplib.h.

+ Here is the caller graph for this function:

◆ has_crlf()

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

Definition at line 5304 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ has_header()

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

Definition at line 4105 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ if2ip()

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

Definition at line 3587 of file httplib.h.

+ Here is the caller graph for this function:

◆ is_chunked_transfer_encoding()

bool is_chunked_transfer_encoding ( const Headers & headers)
inline

Definition at line 4321 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_connection_error()

bool is_connection_error ( )
inline

Definition at line 3550 of file httplib.h.

+ Here is the caller graph for this function:

◆ is_hex()

bool is_hex ( char c,
int & v )
inline

Definition at line 2519 of file httplib.h.

+ Here is the caller graph for this function:

◆ is_multipart_boundary_chars_valid()

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

Definition at line 5072 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_socket_alive()

bool is_socket_alive ( socket_t sock)
inline

Definition at line 3218 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_space_or_tab()

bool is_space_or_tab ( char c)
inline

Definition at line 2785 of file httplib.h.

+ Here is the caller graph for this function:

◆ is_valid_path()

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

Definition at line 2622 of file httplib.h.

◆ keep_alive()

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

Definition at line 3283 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_content_range_header_field()

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

Definition at line 5194 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_multipart_data_boundary()

std::string make_multipart_data_boundary ( )
inline

Definition at line 5068 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_multipart_ranges_data()

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 )
inline

Definition at line 5245 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_unique() [1/2]

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

Definition at line 333 of file httplib.h.

+ Here is the caller graph for this function:

◆ make_unique() [2/2]

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

Definition at line 339 of file httplib.h.

◆ params_to_query_str()

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

Definition at line 4676 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_disposition_params()

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

Definition at line 4726 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_header()

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

Definition at line 4120 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_multipart_boundary()

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

Definition at line 4715 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_query_text() [1/2]

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

Definition at line 4688 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_query_text() [2/2]

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

Definition at line 4711 of file httplib.h.

+ Here is the call graph for this function:

◆ parse_range_header()

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

Definition at line 4753 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_www_authenticate()

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

Definition at line 5548 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepare_content_receiver()

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

Definition at line 4327 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_client_socket()

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,
std::function< bool(Stream &)> callback )
inline

Definition at line 3350 of file httplib.h.

◆ process_multipart_ranges_data()

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 )

Definition at line 5209 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_server_socket()

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 )
inline

Definition at line 3336 of file httplib.h.

+ Here is the call graph for this function:

◆ process_server_socket_core()

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 )
inline

Definition at line 3318 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ random_string()

std::string random_string ( size_t length)
inline

Definition at line 5046 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ range_error()

bool range_error ( Request & req,
Response & res )
inline

Definition at line 5129 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_content()

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

Definition at line 4375 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_content_chunked()

template<typename T>
bool read_content_chunked ( Stream & strm,
T & x,
ContentReceiverWithProgress out )
inline

Definition at line 4256 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_content_with_length()

bool read_content_with_length ( Stream & strm,
uint64_t len,
Progress progress,
ContentReceiverWithProgress out )
inline

Definition at line 4207 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_content_without_length()

bool read_content_without_length ( Stream & strm,
ContentReceiverWithProgress out )
inline

Definition at line 4240 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_file()

void read_file ( const std::string & path,
std::string & out )
inline

Definition at line 2769 of file httplib.h.

◆ read_headers()

bool read_headers ( Stream & strm,
Headers & headers )
inline

Definition at line 4168 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_socket()

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

Definition at line 3080 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirect()

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

Definition at line 4650 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ select_read()

ssize_t select_read ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 3105 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ select_write()

ssize_t select_write ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 3133 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_socket()

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

Definition at line 3092 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multipart_formdata()

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

Definition at line 5115 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multipart_formdata_finish()

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

Definition at line 5105 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multipart_formdata_get_content_type()

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

Definition at line 5110 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multipart_formdata_item_begin()

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

Definition at line 5086 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multipart_formdata_item_end()

std::string serialize_multipart_formdata_item_end ( )
inline

Definition at line 5102 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_nonblocking()

void set_nonblocking ( socket_t sock,
bool nonblocking )
inline

Definition at line 3539 of file httplib.h.

+ Here is the caller graph for this function:

◆ shutdown_socket()

int shutdown_socket ( socket_t sock)
inline

Definition at line 3360 of file httplib.h.

+ Here is the caller graph for this function:

◆ skip_content_with_length()

void skip_content_with_length ( Stream & strm,
uint64_t len )
inline

Definition at line 4229 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ split() [1/2]

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

Definition at line 2836 of file httplib.h.

+ Here is the call graph for this function:

◆ split() [2/2]

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

Definition at line 2831 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ str2tag()

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

Definition at line 3780 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ str2tag_core()

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

Definition at line 3768 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ to_utf8()

size_t to_utf8 ( int code,
char * buff )
inline

Definition at line 2560 of file httplib.h.

+ Here is the caller graph for this function:

◆ trim()

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

Definition at line 2787 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trim_copy()

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

Definition at line 2798 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trim_double_quotes_copy()

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

Definition at line 2803 of file httplib.h.

+ Here is the caller graph for this function:

◆ unescape_abstract_namespace_unix_domain()

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

Definition at line 3378 of file httplib.h.

+ Here is the caller graph for this function:

◆ wait_until_socket_is_ready()

Error wait_until_socket_is_ready ( socket_t sock,
time_t sec,
time_t usec )
inline

Definition at line 3161 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_content() [1/2]

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

Definition at line 4493 of file httplib.h.

+ Here is the call graph for this function:

◆ write_content() [2/2]

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

Definition at line 4455 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_content_chunked() [1/2]

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

Definition at line 4641 of file httplib.h.

+ Here is the call graph for this function:

◆ write_content_chunked() [2/2]

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

Definition at line 4537 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_content_without_length()

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

Definition at line 4503 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_data()

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

Definition at line 4444 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_headers()

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

Definition at line 4425 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_multipart_ranges_data()

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 )
inline

Definition at line 5281 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_request_line()

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

Definition at line 4407 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_response_line()

ssize_t write_response_line ( Stream & strm,
int status )
inline

Definition at line 4416 of file httplib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: