Skip to content

Commit f23f9a0

Browse files
committed
Allow configuration to be overriden without source editing
1 parent 46466b1 commit f23f9a0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

httplib.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,45 @@
1111
/*
1212
* Configuration
1313
*/
14+
#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND
1415
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND 5
16+
#endif
17+
18+
#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_USECOND
1519
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_USECOND 0
20+
#endif
21+
22+
#ifndef CPPHTTPLIB_KEEPALIVE_MAX_COUNT
1623
#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT 5
24+
#endif
25+
26+
#ifndef CPPHTTPLIB_READ_TIMEOUT_SECOND
1727
#define CPPHTTPLIB_READ_TIMEOUT_SECOND 5
28+
#endif
29+
30+
#ifndef CPPHTTPLIB_READ_TIMEOUT_USECOND
1831
#define CPPHTTPLIB_READ_TIMEOUT_USECOND 0
32+
#endif
33+
34+
#ifndef CPPHTTPLIB_REQUEST_URI_MAX_LENGTH
1935
#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH 8192
36+
#endif
37+
38+
#ifndef CPPHTTPLIB_REDIRECT_MAX_COUNT
2039
#define CPPHTTPLIB_REDIRECT_MAX_COUNT 20
40+
#endif
41+
42+
#ifndef CPPHTTPLIB_PAYLOAD_MAX_LENGTH
2143
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH (std::numeric_limits<size_t>::max)()
44+
#endif
45+
46+
#ifndef CPPHTTPLIB_RECV_BUFSIZ
2247
#define CPPHTTPLIB_RECV_BUFSIZ size_t(4096u)
48+
#endif
49+
50+
#ifndef CPPHTTPLIB_THREAD_POOL_COUNT
2351
#define CPPHTTPLIB_THREAD_POOL_COUNT 8
52+
#endif
2453

2554
#ifdef _WIN32
2655
#ifndef _CRT_SECURE_NO_WARNINGS

0 commit comments

Comments
 (0)