cvs: pecl /http http_date_api.c
| From: | Michael Wallner | Date: | Thu, 07 Dec 2006 10:10:25 +0000 |
| Subject: | cvs: pecl /http http_date_api.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-6759@lists.php.net to get a copy of this message | ||
mike Thu Dec 7 10:10:25 2006 UTC
Modified files:
/pecl/http http_date_api.c
Log:
- curl folks seem to have identified the MSVC quirks regarding DST offsets
http://cvs.php.net/viewvc.cgi/pecl/http/http_date_api.c?r1=1.14&r2=1.15&diff_format=u
Index: pecl/http/http_date_api.c
diff -u pecl/http/http_date_api.c:1.14 pecl/http/http_date_api.c:1.15
--- pecl/http/http_date_api.c:1.14 Sat Oct 7 12:45:10 2006
+++ pecl/http/http_date_api.c Thu Dec 7 10:10:25 2006
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: http_date_api.c,v 1.14 2006/10/07 12:45:10 mike Exp $ */
+/* $Id: http_date_api.c,v 1.15 2006/12/07 10:10:25 mike Exp $ */
#include "php_http.h"
@@ -161,25 +161,8 @@
/* {{{ time_t http_parse_date(char *) */
PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC)
{
- time_t t = -1;
+ time_t t = parse_date(date);
-#ifdef PHP_WIN32
- /* fix odd offsets with Win32 */
- char tzput[64] = "TZ=";
- const char *tzget = NULL;
-
- if ((tzget = getenv("TZ"))) {
- strlcat(tzput, tzget, 63);
- }
- putenv("TZ=GMT");
-#endif
-
- t = parse_date(date);
-
-#ifdef PHP_WIN32
- putenv(tzput);
-#endif
-
if (-1 == t && !silent) {
http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Could not parse date: %s", date);
}
@@ -339,11 +322,13 @@
long delta;
time_t t2;
- if(!(gmt = php_gmtime_r(&t, &keeptime2))) {
+ if((gmt = php_gmtime_r(&t, &keeptime2))) {
+ tm = *gmt; /* MSVC quirks */
+ } else {
return -1; /* illegal date/time */
}
- t2 = mktime(gmt);
+ t2 = mktime(&tm);
/* Add the time zone diff (between the given timezone and GMT) and the
diff between the local time zone and GMT. */