mirror of
https://github.com/esp8266/Arduino.git
synced 2025-09-09 18:40:33 +03:00
update HTTPCLIENT_1_1_COMPATIBLE (#5389)
* update HTTPCLIENT_1_1_COMPATIBLE: #if instead if #ifdef, set to 1 by default host emulation updates * host CI: minor simplification * revert -j
This commit is contained in:
committed by
Earle F. Philhower, III
parent
4f86a68b56
commit
116da1881c
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "ESP8266HTTPClient.h"
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClientSecure.h>
|
||||
#endif
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <StreamString.h>
|
||||
#include <base64.h>
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
class TransportTraits
|
||||
{
|
||||
public:
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
HTTPClient::HTTPClient()
|
||||
{
|
||||
_client = nullptr;
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
_tcpDeprecated.reset(nullptr);
|
||||
#endif
|
||||
}
|
||||
@@ -147,7 +147,7 @@ void HTTPClient::clear()
|
||||
* @return success bool
|
||||
*/
|
||||
bool HTTPClient::begin(WiFiClient &client, String url) {
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
if(_tcpDeprecated) {
|
||||
DEBUG_HTTPCLIENT("[HTTP-Client][begin] mix up of new and deprecated api\n");
|
||||
_canReuse = false;
|
||||
@@ -186,7 +186,7 @@ bool HTTPClient::begin(WiFiClient &client, String url) {
|
||||
*/
|
||||
bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String uri, bool https)
|
||||
{
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
if(_tcpDeprecated) {
|
||||
DEBUG_HTTPCLIENT("[HTTP-Client][begin] mix up of new and deprecated api\n");
|
||||
_canReuse = false;
|
||||
@@ -205,7 +205,7 @@ bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String ur
|
||||
}
|
||||
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
bool HTTPClient::begin(String url, String httpsFingerprint)
|
||||
{
|
||||
if(_client && !_tcpDeprecated) {
|
||||
@@ -317,7 +317,7 @@ bool HTTPClient::beginInternal(String url, const char* expectedProtocol)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
bool HTTPClient::begin(String host, uint16_t port, String uri)
|
||||
{
|
||||
if(_client && !_tcpDeprecated) {
|
||||
@@ -423,7 +423,7 @@ void HTTPClient::disconnect()
|
||||
_client->stop();
|
||||
_client = nullptr;
|
||||
}
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
if(_tcpDeprecated) {
|
||||
_transportTraits.reset(nullptr);
|
||||
_tcpDeprecated.reset(nullptr);
|
||||
@@ -1035,7 +1035,7 @@ bool HTTPClient::connect(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
if(!_client && _transportTraits) {
|
||||
_tcpDeprecated = _transportTraits->create();
|
||||
_client = _tcpDeprecated.get();
|
||||
@@ -1056,7 +1056,7 @@ bool HTTPClient::connect(void)
|
||||
|
||||
DEBUG_HTTPCLIENT("[HTTP-Client] connected to %s:%u\n", _host.c_str(), _port);
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
#if HTTPCLIENT_1_1_COMPATIBLE
|
||||
if (_tcpDeprecated && !_transportTraits->verify(*_tcpDeprecated, _host.c_str())) {
|
||||
DEBUG_HTTPCLIENT("[HTTP-Client] transport level verify failed\n");
|
||||
_client->stop();
|
||||
|
Reference in New Issue
Block a user