File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
libraries/ESP8266httpClient/src Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,9 @@ int httpClient::handleHeaderResponse() {
386
386
return HTTPC_ERROR_NOT_CONNECTED;
387
387
}
388
388
389
+ _returnCode = -1 ;
390
+ _size = -1 ;
391
+
389
392
while (connected ()) {
390
393
size_t len = _tcp->available ();
391
394
if (len > 0 ) {
@@ -421,7 +424,12 @@ int httpClient::handleHeaderResponse() {
421
424
if (_size) {
422
425
DEBUG_HTTPCLIENT (" [HTTP-Client][handleHeaderResponse] size: %d\n " , _size);
423
426
}
424
- return _returnCode;
427
+ if (_returnCode) {
428
+ return _returnCode;
429
+ } else {
430
+ DEBUG_HTTPCLIENT (" [HTTP-Client][handleHeaderResponse] Remote host is not an HTTP Server!" );
431
+ return HTTPC_ERROR_NO_HTTP_SERVER;
432
+ }
425
433
}
426
434
427
435
} else {
Original file line number Diff line number Diff line change 40
40
#define HTTPC_ERROR_NOT_CONNECTED (-4 )
41
41
#define HTTPC_ERROR_CONNECTION_LOST (-5 )
42
42
#define HTTPC_ERROR_NO_STREAM (-6 )
43
+ #define HTTPC_ERROR_NO_HTTP_SERVER (-7 )
43
44
44
45
45
46
class httpClient {
You can’t perform that action at this time.
0 commit comments