@@ -58,11 +58,11 @@ enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
58
58
#define HTTP_UPLOAD_BUFLEN 2048
59
59
#endif
60
60
61
- #define HTTP_MAX_DATA_WAIT 5000 // ms to wait for the client to send the request
62
- #define HTTP_MAX_DATA_AVAILABLE_WAIT 30 // ms to wait for the client to send the request when there is another client with data available
63
- #define HTTP_MAX_POST_WAIT 5000 // ms to wait for POST data to arrive
64
- #define HTTP_MAX_SEND_WAIT 5000 // ms to wait for data chunk to be ACKed
65
- #define HTTP_MAX_CLOSE_WAIT 2000 // ms to wait for the client to close the connection
61
+ #define HTTP_MAX_DATA_WAIT 5000 // ms to wait for the client to send the request
62
+ #define HTTP_MAX_DATA_AVAILABLE_WAIT 30 // ms to wait for the client to send the request when there is another client with data available
63
+ #define HTTP_MAX_POST_WAIT 5000 // ms to wait for POST data to arrive
64
+ #define HTTP_MAX_SEND_WAIT 5000 // ms to wait for data chunk to be ACKed
65
+ #define HTTP_MAX_CLOSE_WAIT 2000 // ms to wait for the client to close the connection
66
66
67
67
#define CONTENT_LENGTH_UNKNOWN ((size_t ) -1 )
68
68
#define CONTENT_LENGTH_NOT_SET ((size_t ) -2 )
@@ -72,9 +72,9 @@ typedef struct {
72
72
String filename;
73
73
String name;
74
74
String type;
75
- size_t totalSize; // total size of uploaded file so far
76
- size_t currentSize; // size of data currently in buf
77
- size_t contentLength; // size of entire post request, file size + headers and other request data.
75
+ size_t totalSize; // total size of uploaded file so far
76
+ size_t currentSize; // size of data currently in buf
77
+ size_t contentLength; // size of entire post request, file size + headers and other request data.
78
78
uint8_t buf[HTTP_UPLOAD_BUFLEN];
79
79
} HTTPUpload;
80
80
@@ -122,8 +122,8 @@ class ESP8266WebServerTemplate
122
122
void on (const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
123
123
void addHandler (RequestHandlerType* handler);
124
124
void serveStatic (const char * uri, fs::FS& fs, const char * path, const char * cache_header = NULL );
125
- void onNotFound (THandlerFunction fn); // called when handler is not assigned
126
- void onFileUpload (THandlerFunction fn); // handle file uploads
125
+ void onNotFound (THandlerFunction fn); // called when handler is not assigned
126
+ void onFileUpload (THandlerFunction fn); // handle file uploads
127
127
void enableCORS (bool enable);
128
128
void enableETag (bool enable, ETagFunction fn = nullptr );
129
129
@@ -135,21 +135,21 @@ class ESP8266WebServerTemplate
135
135
// Allows setting server options (i.e. SSL keys) by the instantiator
136
136
ServerType &getServer () { return _server; }
137
137
138
- const String& pathArg (unsigned int i) const ; // get request path argument by number
138
+ const String& pathArg (unsigned int i) const ; // get request path argument by number
139
139
const String& arg (const String& name) const ; // get request argument value by name
140
- const String& arg (int i) const ; // get request argument value by number
141
- const String& argName (int i) const ; // get request argument name by number
142
- int args () const ; // get arguments count
143
- bool hasArg (const String& name) const ; // check if argument exists
140
+ const String& arg (int i) const ; // get request argument value by number
141
+ const String& argName (int i) const ; // get request argument name by number
142
+ int args () const ; // get arguments count
143
+ bool hasArg (const String& name) const ; // check if argument exists
144
144
void collectHeaders (const char * headerKeys[], const size_t headerKeysCount); // set the request headers to collect
145
145
template <typename ... Args>
146
- void collectHeaders (const Args&... args); // set the request headers to collect (variadic template version)
146
+ void collectHeaders (const Args&... args); // set the request headers to collect (variadic template version)
147
147
const String& header (const String& name) const ; // get request header value by name
148
- const String& header (int i) const ; // get request header value by number
149
- const String& headerName (int i) const ; // get request header name by number
150
- int headers () const ; // get header count
148
+ const String& header (int i) const ; // get request header value by number
149
+ const String& headerName (int i) const ; // get request header name by number
150
+ int headers () const ; // get header count
151
151
bool hasHeader (const String& name) const ; // check if header exists
152
- const String& hostHeader () const ; // get request host header if available or empty String if not
152
+ const String& hostHeader () const ; // get request host header if available or empty String if not
153
153
154
154
// send response to the client
155
155
// code - HTTP response code, can be 200 or 404
@@ -350,4 +350,4 @@ class ESP8266WebServerTemplate
350
350
using ESP8266WebServer = esp8266webserver::ESP8266WebServerTemplate<WiFiServer>;
351
351
using RequestHandler = esp8266webserver::RequestHandler<WiFiServer>;
352
352
353
- #endif // ESP8266WEBSERVER_H
353
+ #endif // ESP8266WEBSERVER_H
0 commit comments