cvs: pecl /http http.c

From: Date: Sun, 13 Feb 2005 19:48:46 +0000
Subject: cvs: pecl /http http.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-2554@lists.php.net to get a copy of this message
mike Sun Feb 13 14:48:46 2005 EDT Modified files: /pecl/http http.c Log: * fix etag caching * some maintainance in RSHUTDOWN http://cvs.php.net/diff.php/pecl/http/http.c?r1=1.19&r2=1.20&ty=u Index: pecl/http/http.c diff -u pecl/http/http.c:1.19 pecl/http/http.c:1.20 --- pecl/http/http.c:1.19 Sun Feb 13 05:38:50 2005 +++ pecl/http/http.c Sun Feb 13 14:48:46 2005 @@ -13,7 +13,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http.c,v 1.19 2005/02/13 10:38:50 mike Exp $ */ +/* $Id: http.c,v 1.20 2005/02/13 19:48:46 mike Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -442,10 +442,14 @@ 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 @@ } } - RETURN_SUCCESS(http_send_etag(etag, etag_len)); } /* }}} */ @@ -1130,14 +1133,18 @@ /* {{{ 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);

« previous php.pecl.cvs (#2554) next »