From: Michael Wallner Date: Thu, 16 Oct 2014 15:53:14 +0000 (+0200) Subject: no need to "cache" the request TS for a long time now X-Git-Tag: RELEASE_2_2_0_RC1~9^2~24 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=f823ed714484edce075fe39485355f38684daa1e no need to "cache" the request TS for a long time now --- 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, ...)