summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php4.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2001-07-28 11:36:37 +0000
committerZeev Suraski <zeev@php.net>2001-07-28 11:36:37 +0000
commitd87cc976e1156b839fc6d4aa6b473a126802b8e3 (patch)
tree8acb068dd7458e1c8df3a7d8ecb87d065990fdb1 /sapi/apache/mod_php4.c
parentb4f3b9d3ce9f55cf040fb5aa8f201c64646cab43 (diff)
downloadphp-git-d87cc976e1156b839fc6d4aa6b473a126802b8e3.tar.gz
Redesigned thread safety mechanism - nua nua
Diffstat (limited to 'sapi/apache/mod_php4.c')
-rw-r--r--sapi/apache/mod_php4.c66
1 files changed, 32 insertions, 34 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 0a17b61721..a38cc94735 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -64,13 +64,13 @@
/* {{{ Prototypes
*/
-int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC TSRMLS_DC PLS_DC SLS_DC);
+int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC);
void php_save_umask(void);
void php_restore_umask(void);
-int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC);
-char *sapi_apache_read_cookies(SLS_D);
-int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers SLS_DC);
-int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC);
+int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC);
+char *sapi_apache_read_cookies(TSRMLS_D);
+int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC);
+int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC);
static int send_php(request_rec *r, int display_source_mode, char *filename);
static int send_parsed_php(request_rec * r);
static int send_parsed_php_source(request_rec * r);
@@ -127,7 +127,7 @@ void php_save_umask(void)
static int sapi_apache_ub_write(const char *str, uint str_length)
{
int ret=0;
- SLS_FETCH();
+ TSRMLS_FETCH();
if (SG(server_context)) {
ret = rwrite(str, str_length, (request_rec *) SG(server_context));
@@ -155,7 +155,7 @@ static void sapi_apache_flush(void *server_context)
/* {{{ sapi_apache_read_post
*/
-int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC)
+int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
uint total_read_bytes=0, read_bytes;
request_rec *r = (request_rec *) SG(server_context);
@@ -178,7 +178,7 @@ int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC)
/* {{{ sapi_apache_read_cookies
*/
-char *sapi_apache_read_cookies(SLS_D)
+char *sapi_apache_read_cookies(TSRMLS_D)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE");
}
@@ -186,7 +186,7 @@ char *sapi_apache_read_cookies(SLS_D)
/* {{{ sapi_apache_header_handler
*/
-int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers SLS_DC)
+int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC)
{
char *header_name, *header_content, *p;
request_rec *r = (request_rec *) SG(server_context);
@@ -221,7 +221,7 @@ int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
/* {{{ sapi_apache_send_headers
*/
-int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
+int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
{
if(SG(server_context) == NULL) { /* server_context is not here anymore */
return SAPI_HEADER_SEND_FAILED;
@@ -235,7 +235,7 @@ int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
/* {{{ sapi_apache_register_server_variables
*/
-static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
+static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC)
{
register int i;
array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env);
@@ -251,7 +251,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
} else {
val = empty_string;
}
- php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC);
}
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
@@ -266,10 +266,10 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
if (symbol_table
&& !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"))
&& zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) {
- php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC);
}
- php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC);
}
/* }}} */
@@ -290,7 +290,7 @@ static int php_apache_startup(sapi_module_struct *sapi_module)
*/
static void php_apache_log_message(char *message)
{
- SLS_FETCH();
+ TSRMLS_FETCH();
if (SG(server_context)) {
#if MODULE_MAGIC_NUMBER >= 19970831
@@ -309,8 +309,8 @@ static void php_apache_log_message(char *message)
*/
static void php_apache_request_shutdown(void *dummy)
{
- SLS_FETCH();
- APLS_FETCH();
+ TSRMLS_FETCH();
+ TSRMLS_FETCH();
php_output_set_status(0);
SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
@@ -323,10 +323,10 @@ static void php_apache_request_shutdown(void *dummy)
/* {{{ php_apache_sapi_activate
*/
-static int php_apache_sapi_activate(SLS_D)
+static int php_apache_sapi_activate(TSRMLS_D)
{
request_rec *r = (request_rec *) SG(server_context);
- APLS_FETCH();
+ TSRMLS_FETCH();
/*
* For the Apache module version, this bit of code registers a cleanup
@@ -351,7 +351,7 @@ static int php_apache_sapi_activate(SLS_D)
/* {{{ php_apache_get_stat
*/
-static struct stat *php_apache_get_stat(SLS_D)
+static struct stat *php_apache_get_stat(TSRMLS_D)
{
return &((request_rec *) SG(server_context))->finfo;
}
@@ -359,7 +359,7 @@ static struct stat *php_apache_get_stat(SLS_D)
/* {{{ php_apache_getenv
*/
-static char *php_apache_getenv(char *name, size_t name_len SLS_DC)
+static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name);
}
@@ -418,7 +418,7 @@ void php_restore_umask(void)
/* {{{ init_request_info
*/
-static void init_request_info(SLS_D)
+static void init_request_info(TSRMLS_D)
{
request_rec *r = ((request_rec *) SG(server_context));
char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH");
@@ -468,7 +468,7 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry)
/* {{{ php_apache_get_default_mimetype
*/
-static char *php_apache_get_default_mimetype(request_rec *r SLS_DC)
+static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
{
char *mimetype;
@@ -476,7 +476,7 @@ static char *php_apache_get_default_mimetype(request_rec *r SLS_DC)
/* Assume output will be of the default MIME type. Individual
scripts may change this later. */
char *tmpmimetype;
- tmpmimetype = sapi_get_default_content_type(SLS_C);
+ tmpmimetype = sapi_get_default_content_type(TSRMLS_C);
mimetype = pstrdup(r->pool, tmpmimetype);
efree(tmpmimetype);
} else {
@@ -492,11 +492,9 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
{
int retval;
HashTable *per_dir_conf;
- SLS_FETCH();
TSRMLS_FETCH();
- CLS_FETCH();
- PLS_FETCH();
- APLS_FETCH();
+ TSRMLS_FETCH();
+ TSRMLS_FETCH();
if (AP(in_request)) {
zend_file_handle fh;
@@ -505,7 +503,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.opened_path = NULL;
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
- zend_execute_scripts(ZEND_INCLUDE CLS_CC TSRMLS_CC, 1, &fh);
+ zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, 1, &fh);
return OK;
}
@@ -530,7 +528,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
* directive, then decline to handle this request
*/
if (!AP(engine)) {
- r->content_type = php_apache_get_default_mimetype(r SLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
r->allowed |= (1 << METHODS) - 1;
zend_try {
zend_ini_deactivate(TSRMLS_C);
@@ -567,7 +565,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
}
/* Assume output will be of the default MIME type. Individual
scripts may change this later in the request. */
- r->content_type = php_apache_get_default_mimetype(r SLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
/* Init timeout */
hard_timeout("send", r);
@@ -578,8 +576,8 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
add_common_vars(r);
add_cgi_vars(r);
- init_request_info(SLS_C);
- apache_php_module_main(r, display_source_mode CLS_CC TSRMLS_CC PLS_CC SLS_CC);
+ init_request_info(TSRMLS_C);
+ apache_php_module_main(r, display_source_mode TSRMLS_CC);
/* Done, restore umask, turn off timeout, close file and return */
php_restore_umask();
@@ -843,7 +841,7 @@ void php_init_handler(server_rec *s, pool *p)
}
#if MODULE_MAGIC_NUMBER >= 19980527
{
- PLS_FETCH();
+ TSRMLS_FETCH();
if (PG(expose_php)) {
ap_add_version_component("PHP/" PHP_VERSION);
}