|
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) |
|
template<typename T , typename U > |
void | duration_to_sec_and_usec (const T &duration, U callback) |
|
uint64_t | get_header_value_u64 (const Headers &headers, const std::string &key, size_t id, uint64_t def) |
|
std::string | encode_query_param (const std::string &value) |
|
std::string | decode_url (const std::string &s, bool convert_plus_to_space) |
|
void | read_file (const std::string &path, std::string &out) |
|
std::string | trim_copy (const std::string &s) |
|
void | split (const char *b, const char *e, char d, 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, 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, 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, size_t id=0, const char *def=nullptr) |
|
std::string | params_to_query_str (const Params ¶ms) |
|
void | parse_query_text (const std::string &s, Params ¶ms) |
|
bool | parse_multipart_boundary (const std::string &content_type, std::string &boundary) |
|
bool | parse_range_header (const std::string &s, Ranges &ranges) |
|
int | close_socket (socket_t sock) |
|
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 | 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) |
|
size_t | to_utf8 (int code, char *buff) |
|
std::string | base64_encode (const std::string &in) |
|
bool | is_file (const std::string &path) |
|
bool | is_dir (const std::string &path) |
|
bool | is_valid_path (const std::string &path) |
|
std::string | encode_url (const std::string &s) |
|
std::string | file_extension (const std::string &path) |
|
bool | is_space_or_tab (char c) |
|
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) |
|
template<typename T > |
ssize_t | handle_EINTR (T fn) |
|
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 (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) |
|
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, SocketOptions socket_options, BindOrConnect bind_or_connect) |
|
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) |
|
bool | has_header (const Headers &headers, const std::string &key) |
|
bool | compare_case_ignore (const std::string &a, const std::string &b) |
|
template<typename T > |
bool | parse_header (const char *beg, const char *end, T fn) |
|
bool | read_headers (Stream &strm, Headers &headers) |
|
bool | read_content_with_length (Stream &strm, uint64_t len, Progress progress, ContentReceiverWithProgress out) |
|
void | skip_content_with_length (Stream &strm, uint64_t len) |
|
bool | read_content_without_length (Stream &strm, ContentReceiverWithProgress out) |
|
template<typename T > |
bool | read_content_chunked (Stream &strm, T &x, 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, Progress progress, ContentReceiverWithProgress receiver, bool decompress) |
|
ssize_t | write_headers (Stream &strm, const Headers &headers) |
|
bool | write_data (Stream &strm, const char *d, size_t l) |
|
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) |
|
void | parse_disposition_params (const std::string &s, Params ¶ms) |
|
std::string | to_lower (const char *beg, const char *end) |
|
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 MultipartFormDataItems &items, const std::string &boundary, bool finish=true) |
|
std::pair< size_t, size_t > | get_range_offset_and_length (const Request &req, size_t content_length, size_t index) |
|
std::string | make_content_range_header_field (const std::pair< ssize_t, ssize_t > &range, size_t content_length) |
|
template<typename SToken , typename CToken , typename Content > |
bool | process_multipart_ranges_data (const Request &req, Response &res, const std::string &boundary, const std::string &content_type, SToken stoken, CToken ctoken, Content content) |
|
bool | make_multipart_ranges_data (const Request &req, Response &res, const std::string &boundary, const std::string &content_type, std::string &data) |
|
size_t | get_multipart_ranges_data_length (const Request &req, Response &res, const std::string &boundary, const std::string &content_type) |
|
template<typename T > |
bool | write_multipart_ranges_data (Stream &strm, const Request &req, Response &res, const std::string &boundary, const std::string &content_type, const T &is_shutting_down) |
|
std::pair< size_t, size_t > | get_range_offset_and_length (const Request &req, const Response &res, size_t index) |
|
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) |
|
std::string | random_string (size_t length) |
|