Bugs item #1230118, was opened at 2005-06-29 20:27
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1230118&group_id=976
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: curl_getdate(), DST, and cookie expiration
Initial Comment:
Platform: Windows XP
libcurl: 7.14
With the system clock properly configured to
automatically adjust for Daylight Saving Time,
curl_getdate() appears to return a time_t value which
is 1 hour ahead of the correct value. This prevents
cookies from expiring at the proper time.
The following demonstrates the problem:
#include <stdio.h>
#include "curl/curl.h"
int main()
{
time_t tNow = ::time(NULL);
tm tmGMT;
char szGMT[128];
::memcpy(&tmGMT, ::gmtime(&tNow), sizeof(tm));
::strftime( szGMT, 128, "%a, %d-%b-%Y %H:%M:%S GMT",
&tmGMT );
time_t tCURL = ::curl_getdate(szGMT, NULL);
time_t tDiff = tCURL - tNow;
printf("Current time: %s\n", szGMT);
printf("Sytem time_t: %i\n", tNow);
printf("libcurl time_t: %i\n", tCURL);
printf("Difference: %i seconds\n", tCURL - tNow);
return 0;
}
-----------------------------------------------------------
Example run with properly configured system clock
(during DST):
Current time: Thu, 30-Jun-2005 03:02:14 GMT
Sytem time_t: 1120100534
libcurl time_t: 1120104134
Difference: 3600 seconds
-----------------------------------------------------------
Example run with automatic DST adjustment disabled:
Current time: Thu, 30-Jun-2005 03:02:28 GMT
Sytem time_t: 1120100548
libcurl time_t: 1120100548
Difference: 0 seconds
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1230118&group_id=976
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-tracker
Received on 2005-06-30