Skip to content

Commit f41c4a0

Browse files
committed
Allow modification of HTTPSServerConstants using CFLAGS (#49)
1 parent 427839f commit f41c4a0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/HTTPSServerConstants.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,45 @@
4545
// The following lines define limits of the protocol. Exceeding these limits will lead to a 500 error
4646

4747
// Maximum of header lines that are parsed
48+
#ifndef HTTPS_REQUEST_MAX_HEADERS
4849
#define HTTPS_REQUEST_MAX_HEADERS 20
50+
#endif
4951

5052
// Maximum length of the request line (GET /... HTTP/1.1)
53+
#ifndef HTTPS_REQUEST_MAX_REQUEST_LENGTH
5154
#define HTTPS_REQUEST_MAX_REQUEST_LENGTH 128
55+
#endif
5256

5357
// Maximum length of a header line (including name and value)
58+
#ifndef HTTPS_REQUEST_MAX_HEADER_LENGTH
5459
#define HTTPS_REQUEST_MAX_HEADER_LENGTH 384
60+
#endif
5561

5662
// Chunk size used for reading data from the ssl-enabled socket
63+
#ifndef HTTPS_CONNECTION_DATA_CHUNK_SIZE
5764
#define HTTPS_CONNECTION_DATA_CHUNK_SIZE 512
65+
#endif
5866

5967
// Size (in bytes) of the Connection:keep-alive Cache (we need to be able to
6068
// store-and-forward the response to calculate the content-size)
69+
#ifndef HTTPS_KEEPALIVE_CACHESIZE
6170
#define HTTPS_KEEPALIVE_CACHESIZE 1400
71+
#endif
6272

6373
// Timeout for an HTTPS connection without any transmission
74+
#ifndef HTTPS_CONNECTION_TIMEOUT
6475
#define HTTPS_CONNECTION_TIMEOUT 20000
76+
#endif
6577

6678
// Timeout used to wait for shutdown of SSL connection (ms)
6779
// (time for the client to return notify close flag) - without it, truncation attacks might be possible
80+
#ifndef HTTPS_SHUTDOWN_TIMEOUT
6881
#define HTTPS_SHUTDOWN_TIMEOUT 5000
82+
#endif
6983

7084
// Length of a SHA1 hash
85+
#ifndef HTTPS_SHA1_LENGTH
7186
#define HTTPS_SHA1_LENGTH 20
87+
#endif
7288

7389
#endif /* SRC_HTTPSSERVERCONSTANTS_HPP_ */

0 commit comments

Comments
 (0)