mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Made default server and client read/write timeout settings separately
This commit is contained in:
parent
d173a37d17
commit
4c27f9c6ef
1 changed files with 32 additions and 16 deletions
48
httplib.h
48
httplib.h
|
@ -30,20 +30,36 @@
|
|||
#define CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND 0
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_READ_TIMEOUT_SECOND
|
||||
#define CPPHTTPLIB_READ_TIMEOUT_SECOND 300
|
||||
#ifndef CPPHTTPLIB_SERVER_READ_TIMEOUT_SECOND
|
||||
#define CPPHTTPLIB_SERVER_READ_TIMEOUT_SECOND 5
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_READ_TIMEOUT_USECOND
|
||||
#define CPPHTTPLIB_READ_TIMEOUT_USECOND 0
|
||||
#ifndef CPPHTTPLIB_SERVER_READ_TIMEOUT_USECOND
|
||||
#define CPPHTTPLIB_SERVER_READ_TIMEOUT_USECOND 0
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_WRITE_TIMEOUT_SECOND
|
||||
#define CPPHTTPLIB_WRITE_TIMEOUT_SECOND 5
|
||||
#ifndef CPPHTTPLIB_SERVER_WRITE_TIMEOUT_SECOND
|
||||
#define CPPHTTPLIB_SERVER_WRITE_TIMEOUT_SECOND 5
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_WRITE_TIMEOUT_USECOND
|
||||
#define CPPHTTPLIB_WRITE_TIMEOUT_USECOND 0
|
||||
#ifndef CPPHTTPLIB_SERVER_WRITE_TIMEOUT_USECOND
|
||||
#define CPPHTTPLIB_SERVER_WRITE_TIMEOUT_USECOND 0
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_CLIENT_READ_TIMEOUT_SECOND
|
||||
#define CPPHTTPLIB_CLIENT_READ_TIMEOUT_SECOND 300
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_CLIENT_READ_TIMEOUT_USECOND
|
||||
#define CPPHTTPLIB_CLIENT_READ_TIMEOUT_USECOND 0
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_SECOND
|
||||
#define CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_SECOND 5
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_USECOND
|
||||
#define CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_USECOND 0
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_IDLE_INTERVAL_SECOND
|
||||
|
@ -1001,10 +1017,10 @@ protected:
|
|||
std::atomic<socket_t> svr_sock_{INVALID_SOCKET};
|
||||
size_t keep_alive_max_count_ = CPPHTTPLIB_KEEPALIVE_MAX_COUNT;
|
||||
time_t keep_alive_timeout_sec_ = CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND;
|
||||
time_t read_timeout_sec_ = CPPHTTPLIB_READ_TIMEOUT_SECOND;
|
||||
time_t read_timeout_usec_ = CPPHTTPLIB_READ_TIMEOUT_USECOND;
|
||||
time_t write_timeout_sec_ = CPPHTTPLIB_WRITE_TIMEOUT_SECOND;
|
||||
time_t write_timeout_usec_ = CPPHTTPLIB_WRITE_TIMEOUT_USECOND;
|
||||
time_t read_timeout_sec_ = CPPHTTPLIB_SERVER_READ_TIMEOUT_SECOND;
|
||||
time_t read_timeout_usec_ = CPPHTTPLIB_SERVER_READ_TIMEOUT_USECOND;
|
||||
time_t write_timeout_sec_ = CPPHTTPLIB_SERVER_WRITE_TIMEOUT_SECOND;
|
||||
time_t write_timeout_usec_ = CPPHTTPLIB_SERVER_WRITE_TIMEOUT_USECOND;
|
||||
time_t idle_interval_sec_ = CPPHTTPLIB_IDLE_INTERVAL_SECOND;
|
||||
time_t idle_interval_usec_ = CPPHTTPLIB_IDLE_INTERVAL_USECOND;
|
||||
size_t payload_max_length_ = CPPHTTPLIB_PAYLOAD_MAX_LENGTH;
|
||||
|
@ -1498,10 +1514,10 @@ protected:
|
|||
|
||||
time_t connection_timeout_sec_ = CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND;
|
||||
time_t connection_timeout_usec_ = CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND;
|
||||
time_t read_timeout_sec_ = CPPHTTPLIB_READ_TIMEOUT_SECOND;
|
||||
time_t read_timeout_usec_ = CPPHTTPLIB_READ_TIMEOUT_USECOND;
|
||||
time_t write_timeout_sec_ = CPPHTTPLIB_WRITE_TIMEOUT_SECOND;
|
||||
time_t write_timeout_usec_ = CPPHTTPLIB_WRITE_TIMEOUT_USECOND;
|
||||
time_t read_timeout_sec_ = CPPHTTPLIB_CLIENT_READ_TIMEOUT_SECOND;
|
||||
time_t read_timeout_usec_ = CPPHTTPLIB_CLIENT_READ_TIMEOUT_USECOND;
|
||||
time_t write_timeout_sec_ = CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_SECOND;
|
||||
time_t write_timeout_usec_ = CPPHTTPLIB_CLIENT_WRITE_TIMEOUT_USECOND;
|
||||
|
||||
std::string basic_auth_username_;
|
||||
std::string basic_auth_password_;
|
||||
|
|
Loading…
Reference in a new issue