httplib.h File Reference
#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 <exception>
#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>
+ Include dependency graph for httplib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Client
 
class  ClientImpl
 
struct  ClientImpl::Socket
 
class  ContentReader
 
class  DataSink
 
class  BufferStream
 
struct  equal_to
 
struct  hash
 
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
 
struct  MultipartFormData
 
struct  MultipartFormDataProvider
 
struct  Request
 
struct  Response
 
class  Result
 
class  Server
 
class  Stream
 
class  TaskQueue
 
class  ThreadPool
 

Namespaces

 httplib
 
 httplib::detail
 
 httplib::detail::case_ignore
 
 httplib::detail::udl
 

Macros

#define CPPHTTPLIB_CLIENT_READ_TIMEOUT_SECOND   300
 
#define CPPHTTPLIB_CLIENT_READ_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_SECOND   5
 
#define CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_COMPRESSION_BUFSIZ   size_t(16384u)
 
#define CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND   300
 
#define CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH   8192
 
#define CPPHTTPLIB_HEADER_MAX_LENGTH   8192
 
#define CPPHTTPLIB_IDLE_INTERVAL_SECOND   0
 
#define CPPHTTPLIB_IDLE_INTERVAL_USECOND   0
 
#define CPPHTTPLIB_IPV6_V6ONLY   false
 
#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT   100
 
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_CHECK_INTERVAL_USECOND   10000
 
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND   5
 
#define CPPHTTPLIB_LISTEN_BACKLOG   5
 
#define CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT   1024
 
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH   ((std::numeric_limits<size_t>::max)())
 
#define CPPHTTPLIB_RANGE_MAX_COUNT   1024
 
#define CPPHTTPLIB_RECV_BUFSIZ   size_t(16384u)
 
#define CPPHTTPLIB_RECV_FLAGS   0
 
#define CPPHTTPLIB_REDIRECT_MAX_COUNT   20
 
#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH   8192
 
#define CPPHTTPLIB_SEND_FLAGS   0
 
#define CPPHTTPLIB_SERVER_READ_TIMEOUT_SECOND   5
 
#define CPPHTTPLIB_SERVER_READ_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_SERVER_WRITE_TIMEOUT_SECOND   5
 
#define CPPHTTPLIB_SERVER_WRITE_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_TCP_NODELAY   false
 
#define CPPHTTPLIB_THREAD_POOL_COUNT
 
#define CPPHTTPLIB_VERSION   "0.18.3"
 
#define INVALID_SOCKET   (-1)
 
#define USE_IF2IP
 

Typedefs

using ContentProvider = std::function< bool(size_t offset, size_t length, DataSink &sink)>
 
using ContentProviderResourceReleaser = std::function< void(bool success)>
 
using ContentProviderWithoutLength = std::function< bool(size_t offset, DataSink &sink)>
 
using ContentReceiver = std::function< bool(const char *data, size_t data_length)>
 
using ContentReceiverWithProgress = std::function< bool(const char *data, size_t data_length, uint64_t offset, uint64_t total_length)>
 
using Headers = std::unordered_multimap< std::string, std::string, detail::case_ignore::hash, detail::case_ignore::equal_to >
 
using Logger = std::function< void(const Request &, const Response &)>
 
using Match = std::smatch
 
using MultipartContentHeader = std::function< bool(const MultipartFormData &file)>
 
using MultipartFormDataItems = std::vector< MultipartFormData >
 
using MultipartFormDataMap = std::multimap< std::string, MultipartFormData >
 
using MultipartFormDataProviderItems = std::vector< MultipartFormDataProvider >
 
using Params = std::multimap< std::string, std::string >
 
using Progress = std::function< bool(uint64_t current, uint64_t total)>
 
using Range = std::pair< ssize_t, ssize_t >
 
using Ranges = std::vector< Range >
 
using ResponseHandler = std::function< bool(const Response &response)>
 
using socket_t = int
 
using SocketOptions = std::function< void(socket_t sock)>
 

Enumerations

enum  EncodingType { None = 0, Gzip, Brotli }
 
enum  Error {
  Success = 0, Unknown, Connection, BindIPAddress,
  Read, Write, ExceedRedirectCount, Canceled,
  SSLConnection, SSLLoadingCerts, SSLServerVerification, SSLServerHostnameVerification,
  UnsupportedMultipartBoundaryChars, Compression, ConnectionTimeout, ProxyConnection,
  SSLPeerCouldBeClosed_
}
 
enum  StatusCode {
  Continue_100 = 100, SwitchingProtocol_101 = 101, Processing_102 = 102, EarlyHints_103 = 103,
  OK_200 = 200, Created_201 = 201, Accepted_202 = 202, NonAuthoritativeInformation_203 = 203,
  NoContent_204 = 204, ResetContent_205 = 205, PartialContent_206 = 206, MultiStatus_207 = 207,
  AlreadyReported_208 = 208, IMUsed_226 = 226, MultipleChoices_300 = 300, MovedPermanently_301 = 301,
  Found_302 = 302, SeeOther_303 = 303, NotModified_304 = 304, UseProxy_305 = 305,
  unused_306 = 306, TemporaryRedirect_307 = 307, PermanentRedirect_308 = 308, BadRequest_400 = 400,
  Unauthorized_401 = 401, PaymentRequired_402 = 402, Forbidden_403 = 403, NotFound_404 = 404,
  MethodNotAllowed_405 = 405, NotAcceptable_406 = 406, ProxyAuthenticationRequired_407 = 407, RequestTimeout_408 = 408,
  Conflict_409 = 409, Gone_410 = 410, LengthRequired_411 = 411, PreconditionFailed_412 = 412,
  PayloadTooLarge_413 = 413, UriTooLong_414 = 414, UnsupportedMediaType_415 = 415, RangeNotSatisfiable_416 = 416,
  ExpectationFailed_417 = 417, ImATeapot_418 = 418, MisdirectedRequest_421 = 421, UnprocessableContent_422 = 422,
  Locked_423 = 423, FailedDependency_424 = 424, TooEarly_425 = 425, UpgradeRequired_426 = 426,
  PreconditionRequired_428 = 428, TooManyRequests_429 = 429, RequestHeaderFieldsTooLarge_431 = 431, UnavailableForLegalReasons_451 = 451,
  InternalServerError_500 = 500, NotImplemented_501 = 501, BadGateway_502 = 502, ServiceUnavailable_503 = 503,
  GatewayTimeout_504 = 504, HttpVersionNotSupported_505 = 505, VariantAlsoNegotiates_506 = 506, InsufficientStorage_507 = 507,
  LoopDetected_508 = 508, NotExtended_510 = 510, NetworkAuthenticationRequired_511 = 511
}
 

Functions

std::string append_query_params (const std::string &path, const Params &params)
 
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 default_socket_options (socket_t sock)
 
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)
 
bool equal (const std::string &a, const std::string &b)
 
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)
 
std::string get_bearer_token_auth (const Request &req)
 
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 hosted_at (const std::string &hostname)
 
void hosted_at (const std::string &hostname, std::vector< std::string > &addrs)
 
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::pair< std::string, std::string > make_basic_authentication_header (const std::string &username, const std::string &password, bool is_proxy=false)
 
std::pair< std::string, std::string > make_bearer_token_authentication_header (const std::string &token, bool is_proxy=false)
 
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)
 
std::pair< std::string, std::string > make_range_header (const Ranges &ranges)
 
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)
 
constexpr unsigned int operator""_t (const char *s, size_t l)
 
std::ostream & operator<< (std::ostream &os, const Error &obj)
 
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)
 
const char * status_message (int status)
 
unsigned int str2tag (const std::string &s)
 
constexpr unsigned int str2tag_core (const char *s, size_t l, unsigned int h)
 
unsigned char to_lower (int c)
 
std::string to_string (Error error)
 
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)
 

Macro Definition Documentation

◆ CPPHTTPLIB_CLIENT_READ_TIMEOUT_SECOND

#define CPPHTTPLIB_CLIENT_READ_TIMEOUT_SECOND   300

Definition at line 54 of file httplib.h.

◆ CPPHTTPLIB_CLIENT_READ_TIMEOUT_USECOND

#define CPPHTTPLIB_CLIENT_READ_TIMEOUT_USECOND   0

Definition at line 58 of file httplib.h.

◆ CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_SECOND

#define CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_SECOND   5

Definition at line 62 of file httplib.h.

◆ CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_USECOND

#define CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_USECOND   0

Definition at line 66 of file httplib.h.

◆ CPPHTTPLIB_COMPRESSION_BUFSIZ

#define CPPHTTPLIB_COMPRESSION_BUFSIZ   size_t(16384u)

Definition at line 122 of file httplib.h.

◆ CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND

#define CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND   300

Definition at line 30 of file httplib.h.

◆ CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND

#define CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND   0

Definition at line 34 of file httplib.h.

◆ CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH

#define CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH   8192

Definition at line 102 of file httplib.h.

◆ CPPHTTPLIB_HEADER_MAX_LENGTH

#define CPPHTTPLIB_HEADER_MAX_LENGTH   8192

Definition at line 86 of file httplib.h.

◆ CPPHTTPLIB_IDLE_INTERVAL_SECOND

#define CPPHTTPLIB_IDLE_INTERVAL_SECOND   0

Definition at line 70 of file httplib.h.

◆ CPPHTTPLIB_IDLE_INTERVAL_USECOND

#define CPPHTTPLIB_IDLE_INTERVAL_USECOND   0

Definition at line 77 of file httplib.h.

◆ CPPHTTPLIB_IPV6_V6ONLY

#define CPPHTTPLIB_IPV6_V6ONLY   false

Definition at line 114 of file httplib.h.

◆ CPPHTTPLIB_KEEPALIVE_MAX_COUNT

#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT   100

Definition at line 26 of file httplib.h.

◆ CPPHTTPLIB_KEEPALIVE_TIMEOUT_CHECK_INTERVAL_USECOND

#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_CHECK_INTERVAL_USECOND   10000

Definition at line 22 of file httplib.h.

◆ CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND

#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND   5

Definition at line 18 of file httplib.h.

◆ CPPHTTPLIB_LISTEN_BACKLOG

#define CPPHTTPLIB_LISTEN_BACKLOG   5

Definition at line 141 of file httplib.h.

◆ CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT

#define CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT   1024

Definition at line 94 of file httplib.h.

◆ CPPHTTPLIB_PAYLOAD_MAX_LENGTH

#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH   ((std::numeric_limits<size_t>::max)())

Definition at line 98 of file httplib.h.

◆ CPPHTTPLIB_RANGE_MAX_COUNT

#define CPPHTTPLIB_RANGE_MAX_COUNT   1024

Definition at line 106 of file httplib.h.

◆ CPPHTTPLIB_RECV_BUFSIZ

#define CPPHTTPLIB_RECV_BUFSIZ   size_t(16384u)

Definition at line 118 of file httplib.h.

◆ CPPHTTPLIB_RECV_FLAGS

#define CPPHTTPLIB_RECV_FLAGS   0

Definition at line 133 of file httplib.h.

◆ CPPHTTPLIB_REDIRECT_MAX_COUNT

#define CPPHTTPLIB_REDIRECT_MAX_COUNT   20

Definition at line 90 of file httplib.h.

◆ CPPHTTPLIB_REQUEST_URI_MAX_LENGTH

#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH   8192

Definition at line 82 of file httplib.h.

◆ CPPHTTPLIB_SEND_FLAGS

#define CPPHTTPLIB_SEND_FLAGS   0

Definition at line 137 of file httplib.h.

◆ CPPHTTPLIB_SERVER_READ_TIMEOUT_SECOND

#define CPPHTTPLIB_SERVER_READ_TIMEOUT_SECOND   5

Definition at line 38 of file httplib.h.

◆ CPPHTTPLIB_SERVER_READ_TIMEOUT_USECOND

#define CPPHTTPLIB_SERVER_READ_TIMEOUT_USECOND   0

Definition at line 42 of file httplib.h.

◆ CPPHTTPLIB_SERVER_WRITE_TIMEOUT_SECOND

#define CPPHTTPLIB_SERVER_WRITE_TIMEOUT_SECOND   5

Definition at line 46 of file httplib.h.

◆ CPPHTTPLIB_SERVER_WRITE_TIMEOUT_USECOND

#define CPPHTTPLIB_SERVER_WRITE_TIMEOUT_USECOND   0

Definition at line 50 of file httplib.h.

◆ CPPHTTPLIB_TCP_NODELAY

#define CPPHTTPLIB_TCP_NODELAY   false

Definition at line 110 of file httplib.h.

◆ 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 126 of file httplib.h.

◆ CPPHTTPLIB_VERSION

#define CPPHTTPLIB_VERSION   "0.18.3"

Definition at line 11 of file httplib.h.

◆ INVALID_SOCKET

#define INVALID_SOCKET   (-1)

Definition at line 228 of file httplib.h.

◆ USE_IF2IP

#define USE_IF2IP

Definition at line 3583 of file httplib.h.

Typedef Documentation

◆ socket_t

using socket_t = int

Definition at line 226 of file httplib.h.

max
T max(T t1, T t2)
Definition: gdiam.h:51