#include <arpa/inet.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <csignal>
#include <pthread.h>
#include <sys/mman.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <algorithm>
#include <array>
#include <atomic>
#include <cassert>
#include <cctype>
#include <climits>
#include <condition_variable>
#include <cstring>
#include <errno.h>
#include <fcntl.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <sys/stat.h>
#include <thread>
#include <unordered_map>
#include <unordered_set>
#include <utility>
Go to the source code of this file.
|
using | socket_t = int |
|
using | httplib::Headers = std::multimap< std::string, std::string, detail::ci > |
|
using | httplib::Params = std::multimap< std::string, std::string > |
|
using | httplib::Match = std::smatch |
|
using | httplib::Progress = std::function< bool(uint64_t current, uint64_t total)> |
|
using | httplib::ResponseHandler = std::function< bool(const Response &response)> |
|
using | httplib::MultipartFormDataItems = std::vector< MultipartFormData > |
|
using | httplib::MultipartFormDataMap = std::multimap< std::string, MultipartFormData > |
|
using | httplib::ContentProvider = std::function< bool(size_t offset, size_t length, DataSink &sink)> |
|
using | httplib::ContentProviderWithoutLength = std::function< bool(size_t offset, DataSink &sink)> |
|
using | httplib::ContentProviderResourceReleaser = std::function< void(bool success)> |
|
using | httplib::MultipartFormDataProviderItems = std::vector< MultipartFormDataProvider > |
|
using | httplib::ContentReceiverWithProgress = std::function< bool(const char *data, size_t data_length, uint64_t offset, uint64_t total_length)> |
|
using | httplib::ContentReceiver = std::function< bool(const char *data, size_t data_length)> |
|
using | httplib::MultipartContentHeader = std::function< bool(const MultipartFormData &file)> |
|
using | httplib::Range = std::pair< ssize_t, ssize_t > |
|
using | httplib::Ranges = std::vector< Range > |
|
using | httplib::Logger = std::function< void(const Request &, const Response &)> |
|
using | httplib::SocketOptions = std::function< void(socket_t sock)> |
|
|
enum class | httplib::Error {
httplib::Success = 0
, httplib::Unknown
, httplib::Connection
, httplib::BindIPAddress
,
httplib::Read
, httplib::Write
, httplib::ExceedRedirectCount
, httplib::Canceled
,
httplib::SSLConnection
, httplib::SSLLoadingCerts
, httplib::SSLServerVerification
, httplib::UnsupportedMultipartBoundaryChars
,
httplib::Compression
, httplib::ConnectionTimeout
, httplib::ProxyConnection
, httplib::SSLPeerCouldBeClosed_
} |
|
|
template<class T , class... Args> |
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type | httplib::detail::make_unique (Args &&... args) |
|
template<class T > |
std::enable_if< std::is_array< T >::value, std::unique_ptr< T > >::type | httplib::detail::make_unique (std::size_t n) |
|
void | httplib::default_socket_options (socket_t sock) |
|
const char * | httplib::status_message (int status) |
|
std::string | httplib::to_string (const Error error) |
|
std::ostream & | httplib::operator<< (std::ostream &os, const Error &obj) |
|
std::string | httplib::hosted_at (const std::string &hostname) |
|
void | httplib::hosted_at (const std::string &hostname, std::vector< std::string > &addrs) |
|
std::string | httplib::append_query_params (const std::string &path, const Params ¶ms) |
|
std::pair< std::string, std::string > | httplib::make_range_header (Ranges ranges) |
|
std::pair< std::string, std::string > | httplib::make_basic_authentication_header (const std::string &username, const std::string &password, bool is_proxy=false) |
|
std::pair< std::string, std::string > | httplib::make_bearer_token_authentication_header (const std::string &token, bool is_proxy=false) |
|
◆ CPPHTTPLIB_COMPRESSION_BUFSIZ
#define CPPHTTPLIB_COMPRESSION_BUFSIZ size_t(16384u) |
◆ CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND
#define CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND 300 |
◆ CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND
#define CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND 0 |
◆ CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH
#define CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH 8192 |
◆ CPPHTTPLIB_HEADER_MAX_LENGTH
#define CPPHTTPLIB_HEADER_MAX_LENGTH 8192 |
◆ CPPHTTPLIB_IDLE_INTERVAL_SECOND
#define CPPHTTPLIB_IDLE_INTERVAL_SECOND 0 |
◆ CPPHTTPLIB_IDLE_INTERVAL_USECOND
#define CPPHTTPLIB_IDLE_INTERVAL_USECOND 0 |
◆ CPPHTTPLIB_KEEPALIVE_MAX_COUNT
#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT 5 |
◆ CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND 5 |
◆ CPPHTTPLIB_LISTEN_BACKLOG
#define CPPHTTPLIB_LISTEN_BACKLOG 5 |
◆ CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT
#define CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT 1024 |
◆ CPPHTTPLIB_PAYLOAD_MAX_LENGTH
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH ((std::numeric_limits<size_t>::max)()) |
◆ CPPHTTPLIB_READ_TIMEOUT_SECOND
#define CPPHTTPLIB_READ_TIMEOUT_SECOND 5 |
◆ CPPHTTPLIB_READ_TIMEOUT_USECOND
#define CPPHTTPLIB_READ_TIMEOUT_USECOND 0 |
◆ CPPHTTPLIB_RECV_BUFSIZ
#define CPPHTTPLIB_RECV_BUFSIZ size_t(4096u) |
◆ CPPHTTPLIB_RECV_FLAGS
#define CPPHTTPLIB_RECV_FLAGS 0 |
◆ CPPHTTPLIB_REDIRECT_MAX_COUNT
#define CPPHTTPLIB_REDIRECT_MAX_COUNT 20 |
◆ CPPHTTPLIB_REQUEST_URI_MAX_LENGTH
#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH 8192 |
◆ CPPHTTPLIB_SEND_FLAGS
#define CPPHTTPLIB_SEND_FLAGS 0 |
◆ CPPHTTPLIB_TCP_NODELAY
#define CPPHTTPLIB_TCP_NODELAY false |
◆ CPPHTTPLIB_THREAD_POOL_COUNT
#define CPPHTTPLIB_THREAD_POOL_COUNT |
Value: ((std::max)(8u, std::thread::hardware_concurrency() > 0 \
? std::thread::hardware_concurrency() - 1 \
: 0))
Definition at line 98 of file httplib.h.
◆ CPPHTTPLIB_VERSION
#define CPPHTTPLIB_VERSION "0.14.0" |
◆ CPPHTTPLIB_WRITE_TIMEOUT_SECOND
#define CPPHTTPLIB_WRITE_TIMEOUT_SECOND 5 |
◆ CPPHTTPLIB_WRITE_TIMEOUT_USECOND
#define CPPHTTPLIB_WRITE_TIMEOUT_USECOND 0 |
◆ INVALID_SOCKET
#define INVALID_SOCKET (-1) |
◆ USE_IF2IP
◆ socket_t