mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
ESP8266HTTPUpdateServer: fix responses after uploading
- fix response not being delivered to the browser after upload is done (https://github.com/esp8266/Arduino/issues/2221) - if Update.begin fails, don’t attempt to write data - if update is not successful, send error message from Update to the client - move strings into PROGMEM
This commit is contained in:
committed by
Ivan Grokhotkov
parent
b623613b2a
commit
ace0622e46
@ -5,15 +5,6 @@ class ESP8266WebServer;
|
||||
|
||||
class ESP8266HTTPUpdateServer
|
||||
{
|
||||
private:
|
||||
bool _serial_output;
|
||||
ESP8266WebServer *_server;
|
||||
static const char *_serverIndex;
|
||||
static const char *_failedResponse;
|
||||
static const char *_successResponse;
|
||||
char * _username;
|
||||
char * _password;
|
||||
bool _authenticated;
|
||||
public:
|
||||
ESP8266HTTPUpdateServer(bool serial_debug=false);
|
||||
|
||||
@ -33,6 +24,17 @@ class ESP8266HTTPUpdateServer
|
||||
}
|
||||
|
||||
void setup(ESP8266WebServer *server, const char * path, const char * username, const char * password);
|
||||
|
||||
protected:
|
||||
void _setUpdaterError();
|
||||
|
||||
private:
|
||||
bool _serial_output;
|
||||
ESP8266WebServer *_server;
|
||||
char * _username;
|
||||
char * _password;
|
||||
bool _authenticated;
|
||||
String _updaterError;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user