|
std::string | base64_encode (const std::string &in) |
|
int | close_socket (socket_t sock) |
|
template<typename Fn > |
socket_t | create_socket (const char *host, int port, Fn fn, int socket_flags=0) |
|
std::string | decode_url (const std::string &s) |
|
std::string | encode_url (const std::string &s) |
|
std::string | file_extension (const std::string &path) |
|
const char * | find_content_type (const std::string &path) |
|
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 char *key, size_t id=0, const char *def=nullptr) |
|
uint64_t | get_header_value_uint64 (const Headers &headers, const char *key, int def=0) |
|
size_t | get_multipart_ranges_data_length (const Request &req, Response &res, const std::string &boundary, const std::string &content_type) |
|
std::pair< size_t, size_t > | get_range_offset_and_length (const Request &req, const Response &res, size_t index) |
|
std::pair< size_t, size_t > | get_range_offset_and_length (const Request &req, size_t content_length, size_t index) |
|
std::string | get_remote_addr (socket_t sock) |
|
bool | has_header (const Headers &headers, const char *key) |
|
bool | is_chunked_transfer_encoding (const Headers &headers) |
|
bool | is_connection_error () |
|
bool | is_dir (const std::string &path) |
|
bool | is_file (const std::string &path) |
|
bool | is_hex (char c, int &v) |
|
bool | is_valid_path (const std::string &path) |
|
std::string | make_content_range_header_field (size_t offset, size_t length, size_t content_length) |
|
std::string | make_multipart_data_boundary () |
|
std::string | make_multipart_ranges_data (const Request &req, Response &res, const std::string &boundary, const std::string &content_type) |
|
bool | parse_multipart_boundary (const std::string &content_type, std::string &boundary) |
|
bool | parse_multipart_formdata (const std::string &boundary, const std::string &body, MultipartFiles &files) |
|
void | parse_query_text (const std::string &s, Params ¶ms) |
|
bool | parse_range_header (const std::string &s, Ranges &ranges) |
|
template<typename T > |
bool | process_and_close_socket (bool is_client_request, socket_t sock, size_t keep_alive_max_count, time_t read_timeout_sec, time_t read_timeout_usec, T callback) |
|
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) |
|
template<typename T > |
bool | read_content (Stream &strm, T &x, size_t payload_max_length, int &status, Progress progress, ContentReceiver receiver) |
|
bool | read_content_chunked (Stream &strm, ContentReceiver out) |
|
bool | read_content_with_length (Stream &strm, uint64_t len, Progress progress, ContentReceiver out) |
|
bool | read_content_without_length (Stream &strm, ContentReceiver out) |
|
void | read_file (const std::string &path, std::string &out) |
|
bool | read_headers (Stream &strm, Headers &headers) |
|
template<typename T > |
bool | redirect (T &cli, const Request &req, Response &res, const std::string &path) |
|
int | select_read (socket_t sock, time_t sec, time_t usec) |
|
void | set_nonblocking (socket_t sock, bool nonblocking) |
|
int | shutdown_socket (socket_t sock) |
|
void | skip_content_with_length (Stream &strm, uint64_t len) |
|
template<class Fn > |
void | split (const char *b, const char *e, char d, Fn fn) |
|
const char * | status_message (int status) |
|
std::string | to_lower (const char *beg, const char *end) |
|
size_t | to_utf8 (int code, char *buff) |
|
bool | wait_until_socket_is_ready (socket_t sock, time_t sec, time_t usec) |
|
ssize_t | write_content (Stream &strm, ContentProviderWithCloser content_provider, size_t offset, size_t length) |
|
ssize_t | write_content_chunked (Stream &strm, ContentProviderWithCloser content_provider) |
|
template<typename T > |
int | write_headers (Stream &strm, const T &info, const Headers &headers) |
|
bool | write_multipart_ranges_data (Stream &strm, const Request &req, Response &res, const std::string &boundary, const std::string &content_type) |
|