fixes PlatformIO 6.2.0 breaks compilation #1166 (thanks Michael)

This commit is contained in:
Proddy
2023-04-30 16:22:51 +02:00
parent 0d9cd64619
commit dc4bd64aff
5 changed files with 2362 additions and 2361 deletions

View File

@@ -229,8 +229,8 @@ class AsyncWebServerRequest {
const String& contentType() const { return _contentType; } const String& contentType() const { return _contentType; }
size_t contentLength() const { return _contentLength; } size_t contentLength() const { return _contentLength; }
bool multipart() const { return _isMultipart; } bool multipart() const { return _isMultipart; }
const __FlashStringHelper *methodToString() const; const char *methodToString() const;
const __FlashStringHelper *requestedConnTypeToString() const; const char *requestedConnTypeToString() const;
RequestedConnectionType requestedConnType() const { return _reqconntype; } RequestedConnectionType requestedConnType() const { return _reqconntype; }
bool isExpectedRequestedConnType(RequestedConnectionType erct1, RequestedConnectionType erct2 = RCT_NOT_USED, RequestedConnectionType erct3 = RCT_NOT_USED); bool isExpectedRequestedConnType(RequestedConnectionType erct1, RequestedConnectionType erct2 = RCT_NOT_USED, RequestedConnectionType erct3 = RCT_NOT_USED);
void onDisconnect (ArDisconnectHandler fn); void onDisconnect (ArDisconnectHandler fn);

View File

@@ -141,7 +141,7 @@ String requestDigestAuthentication(const char * realm){
return header; return header;
} }
bool checkDigestAuthentication(const char * header, const __FlashStringHelper *method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri){ bool checkDigestAuthentication(const char * header, const char *method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri){
if(username == NULL || password == NULL || header == NULL || method == NULL){ if(username == NULL || password == NULL || header == NULL || method == NULL){
//os_printf("AUTH FAIL: missing requred fields\n"); //os_printf("AUTH FAIL: missing requred fields\n");
return false; return false;

View File

@@ -26,7 +26,7 @@
bool checkBasicAuthentication(const char * header, const char * username, const char * password); bool checkBasicAuthentication(const char * header, const char * username, const char * password);
String requestDigestAuthentication(const char * realm); String requestDigestAuthentication(const char * realm);
bool checkDigestAuthentication(const char * header, const __FlashStringHelper *method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri); bool checkDigestAuthentication(const char * header, const char *method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri);
//for storing hashed versions on the device that can be authenticated against //for storing hashed versions on the device that can be authenticated against
String generateDigestHash(const char * username, const char * password, const char * realm); String generateDigestHash(const char * username, const char * password, const char * realm);

View File

@@ -898,26 +898,26 @@ String AsyncWebServerRequest::urlDecode(const String& text) const {
} }
const __FlashStringHelper *AsyncWebServerRequest::methodToString() const { const char *AsyncWebServerRequest::methodToString() const {
if(_method == HTTP_ANY) return F("ANY"); if(_method == HTTP_ANY) return ("ANY");
else if(_method & HTTP_GET) return F("GET"); else if(_method & HTTP_GET) return ("GET");
else if(_method & HTTP_POST) return F("POST"); else if(_method & HTTP_POST) return ("POST");
else if(_method & HTTP_DELETE) return F("DELETE"); else if(_method & HTTP_DELETE) return ("DELETE");
else if(_method & HTTP_PUT) return F("PUT"); else if(_method & HTTP_PUT) return ("PUT");
else if(_method & HTTP_PATCH) return F("PATCH"); else if(_method & HTTP_PATCH) return ("PATCH");
else if(_method & HTTP_HEAD) return F("HEAD"); else if(_method & HTTP_HEAD) return ("HEAD");
else if(_method & HTTP_OPTIONS) return F("OPTIONS"); else if(_method & HTTP_OPTIONS) return ("OPTIONS");
return F("UNKNOWN"); return ("UNKNOWN");
} }
const __FlashStringHelper *AsyncWebServerRequest::requestedConnTypeToString() const { const char *AsyncWebServerRequest::requestedConnTypeToString() const {
switch (_reqconntype) { switch (_reqconntype) {
case RCT_NOT_USED: return F("RCT_NOT_USED"); case RCT_NOT_USED: return ("RCT_NOT_USED");
case RCT_DEFAULT: return F("RCT_DEFAULT"); case RCT_DEFAULT: return ("RCT_DEFAULT");
case RCT_HTTP: return F("RCT_HTTP"); case RCT_HTTP: return ("RCT_HTTP");
case RCT_WS: return F("RCT_WS"); case RCT_WS: return ("RCT_WS");
case RCT_EVENT: return F("RCT_EVENT"); case RCT_EVENT: return ("RCT_EVENT");
default: return F("ERROR"); default: return ("ERROR");
} }
} }

View File

@@ -37,53 +37,54 @@ void* memchr(void* ptr, int ch, size_t count)
* Abstract Response * Abstract Response
* */ * */
const char* AsyncWebServerResponse::_responseCodeToString(int code) { const char* AsyncWebServerResponse::_responseCodeToString(int code) {
return reinterpret_cast<const char *>(responseCodeToString(code)); switch (code) {
case 100: return ("Continue");
case 101: return ("Switching Protocols");
case 200: return ("OK");
case 201: return ("Created");
case 202: return ("Accepted");
case 203: return ("Non-Authoritative Information");
case 204: return ("No Content");
case 205: return ("Reset Content");
case 206: return ("Partial Content");
case 300: return ("Multiple Choices");
case 301: return ("Moved Permanently");
case 302: return ("Found");
case 303: return ("See Other");
case 304: return ("Not Modified");
case 305: return ("Use Proxy");
case 307: return ("Temporary Redirect");
case 400: return ("Bad Request");
case 401: return ("Unauthorized");
case 402: return ("Payment Required");
case 403: return ("Forbidden");
case 404: return ("Not Found");
case 405: return ("Method Not Allowed");
case 406: return ("Not Acceptable");
case 407: return ("Proxy Authentication Required");
case 408: return ("Request Time-out");
case 409: return ("Conflict");
case 410: return ("Gone");
case 411: return ("Length Required");
case 412: return ("Precondition Failed");
case 413: return ("Request Entity Too Large");
case 414: return ("Request-URI Too Large");
case 415: return ("Unsupported Media Type");
case 416: return ("Requested range not satisfiable");
case 417: return ("Expectation Failed");
case 500: return ("Internal Server Error");
case 501: return ("Not Implemented");
case 502: return ("Bad Gateway");
case 503: return ("Service Unavailable");
case 504: return ("Gateway Time-out");
case 505: return ("HTTP Version not supported");
case 507: return ("Insufficient Storage");
default: return ("");
}
} }
const __FlashStringHelper *AsyncWebServerResponse::responseCodeToString(int code) { const __FlashStringHelper *AsyncWebServerResponse::responseCodeToString(int code) {
switch (code) { return reinterpret_cast<const __FlashStringHelper*>(responseCodeToString(code));
case 100: return F("Continue");
case 101: return F("Switching Protocols");
case 200: return F("OK");
case 201: return F("Created");
case 202: return F("Accepted");
case 203: return F("Non-Authoritative Information");
case 204: return F("No Content");
case 205: return F("Reset Content");
case 206: return F("Partial Content");
case 300: return F("Multiple Choices");
case 301: return F("Moved Permanently");
case 302: return F("Found");
case 303: return F("See Other");
case 304: return F("Not Modified");
case 305: return F("Use Proxy");
case 307: return F("Temporary Redirect");
case 400: return F("Bad Request");
case 401: return F("Unauthorized");
case 402: return F("Payment Required");
case 403: return F("Forbidden");
case 404: return F("Not Found");
case 405: return F("Method Not Allowed");
case 406: return F("Not Acceptable");
case 407: return F("Proxy Authentication Required");
case 408: return F("Request Time-out");
case 409: return F("Conflict");
case 410: return F("Gone");
case 411: return F("Length Required");
case 412: return F("Precondition Failed");
case 413: return F("Request Entity Too Large");
case 414: return F("Request-URI Too Large");
case 415: return F("Unsupported Media Type");
case 416: return F("Requested range not satisfiable");
case 417: return F("Expectation Failed");
case 500: return F("Internal Server Error");
case 501: return F("Not Implemented");
case 502: return F("Bad Gateway");
case 503: return F("Service Unavailable");
case 504: return F("Gateway Time-out");
case 505: return F("HTTP Version not supported");
default: return F("");
}
} }
AsyncWebServerResponse::AsyncWebServerResponse() AsyncWebServerResponse::AsyncWebServerResponse()