forked from fhessel/esp32_https_server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTTPSServerConstants.hpp
More file actions
42 lines (30 loc) · 1.53 KB
/
HTTPSServerConstants.hpp
File metadata and controls
42 lines (30 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* HTTPSServerConstants.hpp
*
* Created on: Dec 14, 2017
* Author: frank
*/
#ifndef HTTPS_HTTPSSERVERCONSTANTS_HPP_
#define HTTPS_HTTPSSERVERCONSTANTS_HPP_
#include "Arduino.h"
// Debug Code. Undefine it to disable debugging output
#define HTTPS_DLOG(X) Serial.print("HTTPSServer->debug: ");Serial.println(X);
#define HTTPS_DLOGHEX(X,Y) Serial.print("HTTPSServer->debug: ");Serial.print(X);Serial.print(" 0x");Serial.println(Y, HEX);
// The following lines define limits of the protocol. Exceeding these limits will lead to a 500 error
// Maximum of header lines that are parsed
#define HTTPS_REQUEST_MAX_HEADERS 20
// Maximum length of the request line (GET /... HTTP/1.1)
#define HTTPS_REQUEST_MAX_REQUEST_LENGTH 128
// Maximum length of a header line (including name and value)
#define HTTPS_REQUEST_MAX_HEADER_LENGTH 384
// Chunk size used for reading data from the ssl-enabled socket
#define HTTPS_CONNECTION_DATA_CHUNK_SIZE 512
// Size (in bytes) of the Connection:keep-alive Cache (we need to be able to
// store-and-forward the response to calculate the content-size)
#define HTTPS_KEEPALIVE_CACHESIZE 1400
// Timeout for an HTTPS connection without any transmission
#define HTTPS_CONNECTION_TIMEOUT 20000
// Timeout used to wait for shutdown of SSL connection (ms)
// (time for the client to return notify close flag) - without it, truncation attacks might be possible
#define HTTPS_SHUTDOWN_TIMEOUT 5000
#endif /* HTTPS_HTTPSSERVERCONSTANTS_HPP_ */