Skip to content

Commit 37dfbd9

Browse files
committed
info: Connect to new host...
1 parent fb07785 commit 37dfbd9

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/Audio.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Created on: Oct 26.2018
55
*
6-
* Version 3.0.12a
6+
* Version 3.0.12b
77
* Updated on: Jul 27.2024
88
* Author: Wolle (schreibfaul1)
99
*
@@ -555,7 +555,6 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) {
555555
hostwoext[pos_colon] = '\0'; // Host without portnumber
556556
}
557557

558-
AUDIO_INFO("Connect to new host: \"%s\"", l_host);
559558
setDefaults(); // no need to stop clients if connection is established (default is true)
560559

561560
if(startsWith(l_host, "https")) m_f_ssl = true;
@@ -597,12 +596,6 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) {
597596
// strcat(rqh, "User-Agent: Mozilla/5.0\r\n"); #363
598597
strcat(rqh, "Connection: keep-alive\r\n\r\n");
599598

600-
// if(ESP_ARDUINO_VERSION_MAJOR == 2 && ESP_ARDUINO_VERSION_MINOR == 0 && ESP_ARDUINO_VERSION_PATCH >= 3){
601-
// m_timeout_ms_ssl = UINT16_MAX; // bug in v2.0.3 if hostwoext is a IPaddr not a name
602-
// m_timeout_ms = UINT16_MAX; // [WiFiClient.cpp:253] connect(): select returned due to timeout 250 ms for
603-
// fd 48
604-
// } fix in V2.0.8
605-
606599
bool res = true; // no need to reconnect if connection exists
607600

608601
if(m_f_ssl) {
@@ -612,8 +605,11 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) {
612605
else { _client = static_cast<WiFiClient*>(&client); }
613606

614607
uint32_t t = millis();
615-
if(m_f_Log) AUDIO_INFO("connect to %s on port %d path %s", hostwoext, port, extension);
616-
res = _client->connect(hostwoext, port, m_f_ssl ? m_timeout_ms_ssl : m_timeout_ms);
608+
609+
AUDIO_INFO("connect to %s on port %d path %s", hostwoext, port, extension);
610+
611+
_client->setTimeout(m_f_ssl ? m_timeout_ms_ssl : m_timeout_ms);
612+
res = _client->connect(hostwoext, port);
617613
if(res) {
618614
uint32_t dt = millis() - t;
619615
strcpy(m_lastHost, l_host);

src/Audio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Created on: Oct 28,2018
55
*
6-
* Version 3.0.12a
6+
* Version 3.0.12b
77
* Updated on: Jul 27.2024
88
* Author: Wolle (schreibfaul1)
99
*/

0 commit comments

Comments
 (0)