- don't raise notice when checking If-Range header for a last modification date
authorMichael Wallner <mike@php.net>
Sat, 7 Oct 2006 12:45:10 +0000 (12:45 +0000)
committerMichael Wallner <mike@php.net>
Sat, 7 Oct 2006 12:45:10 +0000 (12:45 +0000)
http_cache_api.c
http_date_api.c
php_http_date_api.h

index 9a6ea89057ea0d122ad68d98b63b958de507f614..adba374d5c65ef90726a5e4d4f9100a07a092709 100644 (file)
@@ -85,7 +85,7 @@ PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t,
                chr_ptr = 0;
        }
        
                chr_ptr = 0;
        }
        
-       retval = (t <= http_parse_date(modified));
+       retval = (t <= http_parse_date_ex(modified, 1));
        efree(modified);
        return retval;
 }
        efree(modified);
        return retval;
 }
index 10f3463a437c8efd2ab5cee7636f8c22ba2815f9..32efdfb8bc6b706c6af6c480d4dda2100c0a2fe1 100644 (file)
@@ -159,7 +159,7 @@ PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC)
 /* }}} */
 
 /* {{{ time_t http_parse_date(char *) */
 /* }}} */
 
 /* {{{ time_t http_parse_date(char *) */
-PHP_HTTP_API time_t _http_parse_date(const char *date TSRMLS_DC)
+PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC)
 {
        time_t t = -1;
        
 {
        time_t t = -1;
        
@@ -180,7 +180,7 @@ PHP_HTTP_API time_t _http_parse_date(const char *date TSRMLS_DC)
        putenv(tzput);
 #endif
 
        putenv(tzput);
 #endif
 
-       if (-1 == t) {
+       if (-1 == t && !silent) {
                http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Could not parse date: %s", date);
        }
        
                http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Could not parse date: %s", date);
        }
        
index 3356e3856b7edaa1a5b60cde8b20a2e8f1824623..948f6e820d380cf4d0ec85821f5e10975ef24f61 100644 (file)
@@ -18,8 +18,9 @@
 #define http_date(t) _http_date((t) TSRMLS_CC)
 PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC);
 
 #define http_date(t) _http_date((t) TSRMLS_CC)
 PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC);
 
-#define http_parse_date(d) _http_parse_date((d) TSRMLS_CC)
-PHP_HTTP_API time_t _http_parse_date(const char *date TSRMLS_DC);
+#define http_parse_date(d) _http_parse_date_ex((d), 0 TSRMLS_CC)
+#define http_parse_date_ex(d, s) _http_parse_date_ex((d), (s) TSRMLS_CC)
+PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC);
 
 #endif
 
 
 #endif