File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1593,8 +1593,9 @@ void HTTPClient::setCookie(String date, String headerValue) {
15931593
15941594 // overwrite or delete cookie in/from cookie jar
15951595 time_t now_local = time (NULL );
1596- time_t now_gmt = mktime (gmtime (&now_local));
1597-
1596+ struct tm tm_gmt;
1597+ gmtime_r (&now_local, &tm_gmt);
1598+ time_t now_gmt = mktime (&tm_gmt);
15981599 bool found = false ;
15991600
16001601 for (auto c = _cookieJar->begin (); c != _cookieJar->end (); ++c) {
@@ -1619,8 +1620,9 @@ void HTTPClient::setCookie(String date, String headerValue) {
16191620
16201621bool HTTPClient::generateCookieString (String *cookieString) {
16211622 time_t now_local = time (NULL );
1622- time_t now_gmt = mktime (gmtime (&now_local));
1623-
1623+ struct tm tm_gmt;
1624+ gmtime_r (&now_local, &tm_gmt);
1625+ time_t now_gmt = mktime (&tm_gmt);
16241626 *cookieString = " " ;
16251627 bool found = false ;
16261628
You can’t perform that action at this time.
0 commit comments