Skip to content

Commit 4cdcf11

Browse files
authored
Merge branch 'master' into uart-pins
2 parents d926df6 + c99f594 commit 4cdcf11

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

libraries/HTTPClient/src/HTTPClient.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,10 @@ void HTTPClient::clearAllCookies()
15431543

15441544
void HTTPClient::setCookie(String date, String headerValue)
15451545
{
1546+
if (!_cookieJar)
1547+
{
1548+
return;
1549+
}
15461550
#define HTTP_TIME_PATTERN "%a, %d %b %Y %H:%M:%S"
15471551

15481552
Cookie cookie;
@@ -1574,7 +1578,7 @@ void HTTPClient::setCookie(String date, String headerValue)
15741578
value = headerValue.substring(pos1, pos2);
15751579
else
15761580
value = headerValue.substring(pos1);
1577-
1581+
15781582
strptime(value.c_str(), HTTP_TIME_PATTERN, &tm);
15791583
cookie.expires.date = mktime(&tm);
15801584
cookie.expires.valid = true;
@@ -1589,7 +1593,7 @@ void HTTPClient::setCookie(String date, String headerValue)
15891593
value = headerValue.substring(pos1, pos2);
15901594
else
15911595
value = headerValue.substring(pos1);
1592-
1596+
15931597
cookie.max_age.duration = value.toInt();
15941598
cookie.max_age.valid = true;
15951599
}
@@ -1639,10 +1643,10 @@ void HTTPClient::setCookie(String date, String headerValue)
16391643
// overwrite or delete cookie in/from cookie jar
16401644
time_t now_local = time(NULL);
16411645
time_t now_gmt = mktime(gmtime(&now_local));
1642-
1646+
16431647
bool found = false;
16441648

1645-
for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {
1649+
for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {
16461650
if (c->domain == cookie.domain && c->name == cookie.name) {
16471651
// when evaluating, max-age takes precedence over expires if both are defined
16481652
if ((cookie.max_age.valid && ((cookie.date + cookie.max_age.duration) < now_gmt)) || cookie.max_age.duration <= 0
@@ -1670,6 +1674,10 @@ bool HTTPClient::generateCookieString(String *cookieString)
16701674
*cookieString = "";
16711675
bool found = false;
16721676

1677+
if (!_cookieJar)
1678+
{
1679+
return false;
1680+
}
16731681
for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {
16741682
if ((c->max_age.valid && ((c->date + c->max_age.duration) < now_gmt)) || (!c->max_age.valid && c->expires.valid && c->expires.date < now_gmt)) {
16751683
_cookieJar->erase(c);
@@ -1682,5 +1690,6 @@ bool HTTPClient::generateCookieString(String *cookieString)
16821690
found = true;
16831691
}
16841692
}
1693+
16851694
return found;
16861695
}

libraries/WiFi/src/WiFiGeneric.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,10 @@ void WiFiGenericClass::useStaticBuffers(bool bufferMode){
555555
_wifiUseStaticBuffers = bufferMode;
556556
}
557557

558+
// Temporary fix to ensure that CDC+JTAG stay on on ESP32-C3
559+
#if CONFIG_IDF_TARGET_ESP32C3
560+
extern "C" void phy_bbpll_en_usb(bool en);
561+
#endif
558562

559563
bool wifiLowLevelInit(bool persistent){
560564
if(!lowLevelInitDone){
@@ -587,6 +591,10 @@ bool wifiLowLevelInit(bool persistent){
587591
lowLevelInitDone = false;
588592
return lowLevelInitDone;
589593
}
594+
// Temporary fix to ensure that CDC+JTAG stay on on ESP32-C3
595+
#if CONFIG_IDF_TARGET_ESP32C3
596+
phy_bbpll_en_usb(true);
597+
#endif
590598
if(!persistent){
591599
lowLevelInitDone = esp_wifi_set_storage(WIFI_STORAGE_RAM) == ESP_OK;
592600
}

0 commit comments

Comments
 (0)