no need to "cache" the request TS for a long time now
authorMichael Wallner <mike@php.net>
Thu, 16 Oct 2014 15:53:14 +0000 (17:53 +0200)
committerMichael Wallner <mike@php.net>
Thu, 16 Oct 2014 15:53:14 +0000 (17:53 +0200)
php_http_client_curl.c
php_http_env.c
php_http_env.h
php_http_misc.c

index 4056e9260ab9dbfb261c8be5ab04f13cb3c99b36..af77b92271a15f5c373e85d1944ddef0ae61ea07 100644 (file)
@@ -903,7 +903,7 @@ static STATUS php_http_curle_option_set_lastmodified(php_http_option_t *opt, zva
                                return FAILURE;
                        }
                } else {
-                       if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_TIMEVALUE, (long) PHP_HTTP_G->env.request.time + Z_LVAL_P(val))) {
+                       if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_TIMEVALUE, (long) sapi_get_request_time(TSRMLS_C) + Z_LVAL_P(val))) {
                                return FAILURE;
                        }
                }
index 10d54fe4019a5a0472ffc95b1c6bfe1758964279..2969d1a4fbe5b19bb0e5daf354e022ccabd948e2 100644 (file)
@@ -15,8 +15,6 @@
 
 PHP_RINIT_FUNCTION(http_env)
 {
-       PHP_HTTP_G->env.request.time = sapi_get_request_time(TSRMLS_C);
-
        /* populate form data on non-POST requests */
        if (SG(request_info).request_method && strcasecmp(SG(request_info).request_method, "POST") && SG(request_info).content_type && *SG(request_info).content_type) {
                uint ct_len = strlen(SG(request_info).content_type);
index ee1afe92feca016dc5de2e63e0b2d1a3e012d430..7556c3efb68e77e4de0129d1ab18b1e0aeffe3aa 100644 (file)
@@ -21,7 +21,6 @@ struct php_http_env_globals {
        char *etag_mode;
 
        struct {
-               time_t time;
                HashTable *headers;
                php_http_message_body_t *body;
        } request;
index 8fcb82e2449f5f4a2dbb982b5a50a3e1ef60061f..51072cf53da8e59e6578849c28a31bf0d28edb91 100644 (file)
@@ -115,7 +115,7 @@ char *php_http_pretty_key(register char *key, size_t key_len, zend_bool uctitle,
 
 size_t php_http_boundary(char *buf, size_t buf_len TSRMLS_DC)
 {
-       return snprintf(buf, buf_len, "%15.15F", PHP_HTTP_G->env.request.time * php_combined_lcg(TSRMLS_C));
+       return snprintf(buf, buf_len, "%15.15F", sapi_get_request_time(TSRMLS_C) * php_combined_lcg(TSRMLS_C));
 }
 
 int php_http_select_str(const char *cmp, int argc, ...)