cvs: php4 /sapi/apache2filter sapi_apache2.c
| From: | Ilia Alshanetsky | Date: | Fri, 27 Dec 2002 19:59:10 +0000 |
| Subject: | cvs: php4 /sapi/apache2filter sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-17436@lists.php.net to get a copy of this message | ||
iliaa Fri Dec 27 14:59:10 2002 EDT
Modified files:
/php4/sapi/apache2filter sapi_apache2.c
Log:
Fixed bug #17098 (make Apache aware that PHP scripts represent dynamic data
and should not be cached). Fix suggested by daniel.eckl@gmx.de.
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.97 php4/sapi/apache2filter/sapi_apache2.c:1.98
--- php4/sapi/apache2filter/sapi_apache2.c:1.97 Sat Dec 21 16:50:28 2002
+++ php4/sapi/apache2filter/sapi_apache2.c Fri Dec 27 14:59:09 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.97 2002/12/21 21:50:28 moriyoshi Exp $ */
+/* $Id: sapi_apache2.c,v 1.98 2002/12/27 19:59:09 iliaa Exp $ */
#include <fcntl.h>
@@ -261,6 +261,17 @@
}
}
+static int
+php_apache_disable_caching(ap_filter_t *f)
+{
+ /* Identify PHP scripts as non-cacheable, thus preventing
+ * Apache from sending a 304 status when the browser sends
+ * If-Modified-Since header.
+ */
+ f->r->no_local_copy = 1;
+
+ return OK;
+}
extern zend_module_entry php_apache_module;
@@ -654,8 +665,8 @@
ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_insert_filter(php_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_read_request(php_post_read_request, NULL, NULL, APR_HOOK_MIDDLE);
- ap_register_output_filter("PHP", php_output_filter, NULL, AP_FTYPE_RESOURCE);
- ap_register_input_filter("PHP", php_input_filter, NULL, AP_FTYPE_RESOURCE);
+ ap_register_output_filter("PHP", php_output_filter, php_apache_disable_caching,
AP_FTYPE_RESOURCE);
+ ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching,
AP_FTYPE_RESOURCE);
}
AP_MODULE_DECLARE_DATA module php4_module = {