Global fix http(s) connect issues

This commit is contained in:
Theo Arends 2023-04-03 16:12:29 +02:00
parent 6b2efa16dc
commit 542eca3154
3 changed files with 2 additions and 6 deletions

View File

@ -247,7 +247,7 @@ protected:
/// request handling
String _host;
uint16_t _port = 0;
int32_t _connectTimeout = -1;
int32_t _connectTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT; // Do not set to -1 as it fails WiFiClient connect()
bool _reuse = true;
uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;
bool _useHTTP10 = false;

View File

@ -1403,7 +1403,6 @@ void Every250mSeconds(void)
AddLog(LOG_LEVEL_INFO, "OTA: unsupported protocol");
ota_result = -999;
} else {
OTAclient.setConnectTimeout(USE_BERRY_WEBCLIENT_TIMEOUT);
httpUpdateLight.rebootOnUpdate(false);
httpUpdateLight.setFactory(TasmotaGlobal.ota_factory);
ota_result = (HTTP_UPDATE_FAILED != httpUpdateLight.update(OTAclient, version));

View File

@ -3265,7 +3265,6 @@ int WebQuery(char *buffer) {
if (url && method) {
#if defined(ESP32) && defined(USE_WEBCLIENT_HTTPS)
if (http.begin(UrlEncode(url))) {
http.setConnectTimeout(USE_BERRY_WEBCLIENT_TIMEOUT);
#else // HTTP only
if (http.begin(http_client, UrlEncode(url))) {
#endif
@ -3357,7 +3356,6 @@ int WebGetConfig(char *buffer) {
#if defined(ESP32) && defined(USE_WEBCLIENT_HTTPS)
HTTPClientLight http;
if (http.begin(UrlEncode(url))) { // UrlEncode(url) = |http://192.168.178.86/cm?cmnd=POWER1%20ON|
http.setConnectTimeout(USE_BERRY_WEBCLIENT_TIMEOUT);
#else // HTTP only
WiFiClient http_client;
HTTPClient http;
@ -3602,8 +3600,7 @@ void CmndWebQuery(void)
}
#ifdef USE_WEBGETCONFIG
void CmndWebGetConfig(void)
{
void CmndWebGetConfig(void) {
// WebGetConfig http://myserver:8000/tasmota/conf/%id%.dmp where %id% is expanded to device mac address
// WebGetConfig http://myserver:8000/tasmota/conf/Config_demo_9.5.0.8.dmp
if (XdrvMailbox.data_len > 0) {