Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,8 @@ void HTTPClient::setCookie(String date, String headerValue) {

// overwrite or delete cookie in/from cookie jar
time_t now_local = time(NULL);
time_t now_gmt = mktime(gmtime(&now_local));
struct tm timeinfo;
time_t now_gmt = mktime(gmtime_r(&now_local, &timeinfo));

bool found = false;

Expand Down Expand Up @@ -1353,7 +1354,8 @@ bool HTTPClient::generateCookieString(String *cookieString) {
return false;
}
time_t now_local = time(NULL);
time_t now_gmt = mktime(gmtime(&now_local));
struct tm timeinfo;
time_t now_gmt = mktime(gmtime_r(&now_local, &timeinfo));

*cookieString = "";
bool found = false;
Expand Down
Loading