From f823ed714484edce075fe39485355f38684daa1e Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 16 Oct 2014 17:53:14 +0200 Subject: [PATCH] no need to "cache" the request TS for a long time now --- php_http_client_curl.c | 2 +- php_http_env.c | 2 -- php_http_env.h | 1 - php_http_misc.c | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/php_http_client_curl.c b/php_http_client_curl.c index 4056e92..af77b92 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -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; } } diff --git a/php_http_env.c b/php_http_env.c index 10d54fe..2969d1a 100644 --- a/php_http_env.c +++ b/php_http_env.c @@ -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); diff --git a/php_http_env.h b/php_http_env.h index ee1afe9..7556c3e 100644 --- a/php_http_env.h +++ b/php_http_env.h @@ -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; diff --git a/php_http_misc.c b/php_http_misc.c index 8fcb82e..51072cf 100644 --- a/php_http_misc.c +++ b/php_http_misc.c @@ -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, ...) -- 2.30.2