From fef2304c7349f2763620101cf90a21aa495c2b9b Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Sun, 13 Feb 2005 19:48:46 +0000 Subject: [PATCH 1/1] * fix etag caching * some maintainance in RSHUTDOWN --- http.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index bdaed8a..677cf9d 100644 --- a/http.c +++ b/http.c @@ -442,10 +442,14 @@ PHP_FUNCTION(http_cache_etag) php_end_ob_buffers(0 TSRMLS_CC); http_send_header("Cache-Control: private, must-revalidate, max-age=0"); + if (etag_len) { + RETURN_SUCCESS(http_send_etag(etag, etag_len)); + } + /* if no etag is given and we didn't already * start ob_etaghandler -- start it */ - if (!HTTP_G(etag_started) && !etag_len) { + if (!HTTP_G(etag_started)) { php_ob_set_internal_handler(_http_ob_etaghandler, (uint) 4096, "etag output handler", 0 TSRMLS_CC); HTTP_G(etag_started) = 1; RETURN_BOOL(php_start_ob_buffer_named("etag output handler", (uint) 4096, 0 TSRMLS_CC)); @@ -460,7 +464,6 @@ PHP_FUNCTION(http_cache_etag) } } - RETURN_SUCCESS(http_send_etag(etag, etag_len)); } /* }}} */ @@ -1130,14 +1133,18 @@ PHP_RINIT_FUNCTION(http) /* {{{ PHP_RSHUTDOWN_FUNCTION */ PHP_RSHUTDOWN_FUNCTION(http) { - if (HTTP_G(ctype)) { - efree(HTTP_G(ctype)); - HTTP_G(ctype) = NULL; - } + HTTP_G(etag_started) = 0; + HTTP_G(lmod) = 0; + if (HTTP_G(etag)) { efree(HTTP_G(etag)); HTTP_G(etag) = NULL; } + + if (HTTP_G(ctype)) { + efree(HTTP_G(ctype)); + HTTP_G(ctype) = NULL; + } #ifdef HTTP_HAVE_CURL if (HTTP_G(curlbuf).body.data) { efree(HTTP_G(curlbuf).body.data); -- 2.30.2