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 4056e92..af77b92 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 10d54fe..2969d1a 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 ee1afe9..7556c3e 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 8fcb82e..51072cf 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, ...)