1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

rework error handling and detection

add retry for short write
remove compiler warnings
This commit is contained in:
Markus Sattler
2015-12-31 12:00:26 +01:00
parent 7540f11c93
commit bd7d915bcd
2 changed files with 97 additions and 21 deletions

View File

@ -25,7 +25,7 @@
#ifndef ESP8266HTTPClient_H_
#define ESP8266HTTPClient_H_
//#define DEBUG_HTTPCLIENT(...) Serial1.printf( __VA_ARGS__ )
#define DEBUG_HTTPCLIENT(...) Serial1.printf( __VA_ARGS__ )
#ifndef DEBUG_HTTPCLIENT
#define DEBUG_HTTPCLIENT(...)
@ -43,7 +43,8 @@
#define HTTPC_ERROR_NO_HTTP_SERVER (-7)
#define HTTPC_ERROR_TOO_LESS_RAM (-8)
#define HTTPC_ERROR_ENCODING (-9)
#define HTTPC_ERROR_STREAM_WRITE (-10)
#define HTTPC_ERROR_READ_TIMEOUT (-11)
/// size for the stream handling
#define HTTP_TCP_BUFFER_SIZE (1460)
@ -197,7 +198,7 @@ class HTTPClient {
bool _canReuse;
transferEncoding_t _transferEncoding;
int returnError(int error);
bool connect(void);
bool sendHeader(const char * type);
int handleHeaderResponse();