Skip to content

Commit

Permalink
Global fix http(s) connect issues
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Apr 3, 2023
1 parent 6b2efa1 commit 542eca3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class HTTPClientLight
/// 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;
Expand Down
1 change: 0 additions & 1 deletion tasmota/tasmota_support/support_tasmota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
5 changes: 1 addition & 4 deletions tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 542eca3

Please sign in to comment.