Skip to content

Commit 60d8022

Browse files
committed
clear client
delete all leftovers in the clients receive buffer increase timeout for http response in case of timeout do'nt clear lasthost
1 parent 5f44939 commit 60d8022

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Audio.cpp

Lines changed: 5 additions & 3 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.12
6+
* Version 3.0.12a
77
* Updated on: Jul 27.2024
88
* Author: Wolle (schreibfaul1)
99
*
@@ -331,7 +331,9 @@ void Audio::setDefaults() {
331331
m_hashQueue.clear();
332332
m_hashQueue.shrink_to_fit(); // uint32_t vector
333333
client.stop();
334+
client.clear(); // delete all leftovers in the receive buffer
334335
clientsecure.stop();
336+
clientsecure.clear(); // delete all leftovers in the receive buffer
335337
_client = static_cast<WiFiClient*>(&client); /* default to *something* so that no NULL deref can happen */
336338
ts_parsePacket(0, 0, 0); // reset ts routine
337339
if(m_lastM3U8host) {
@@ -3757,7 +3759,7 @@ bool Audio::parseHttpResponseHeader() { // this is the response to a GET / reque
37573759
if(getDatamode() != HTTP_RESPONSE_HEADER) return false;
37583760

37593761
uint32_t ctime = millis();
3760-
uint32_t timeout = 2500; // ms
3762+
uint32_t timeout = 4500; // ms
37613763

37623764
static uint32_t stime;
37633765
static bool f_time = false;
@@ -3973,7 +3975,7 @@ bool Audio::parseHttpResponseHeader() { // this is the response to a GET / reque
39733975
if(audio_icydescription) audio_icydescription("");
39743976
if(audio_icyurl) audio_icyurl("");
39753977
if(m_playlistFormat == FORMAT_M3U8) return false;
3976-
m_lastHost[0] = '\0';
3978+
// m_lastHost[0] = '\0';
39773979
setDatamode(AUDIO_NONE);
39783980
stopSong();
39793981
return false;

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.12
6+
* Version 3.0.12a
77
* Updated on: Jul 27.2024
88
* Author: Wolle (schreibfaul1)
99
*/

0 commit comments

Comments
 (0)