diff options
| author | Zeev Suraski <zeev@php.net> | 2001-07-28 11:36:37 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2001-07-28 11:36:37 +0000 |
| commit | d87cc976e1156b839fc6d4aa6b473a126802b8e3 (patch) | |
| tree | 8acb068dd7458e1c8df3a7d8ecb87d065990fdb1 /sapi/apache2filter | |
| parent | b4f3b9d3ce9f55cf040fb5aa8f201c64646cab43 (diff) | |
| download | php-git-d87cc976e1156b839fc6d4aa6b473a126802b8e3.tar.gz | |
Redesigned thread safety mechanism - nua nua
Diffstat (limited to 'sapi/apache2filter')
| -rw-r--r-- | sapi/apache2filter/php_functions.c | 4 | ||||
| -rw-r--r-- | sapi/apache2filter/sapi_apache2.c | 46 |
2 files changed, 24 insertions, 26 deletions
diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c index 2679c38488..7d1aa1bd08 100644 --- a/sapi/apache2filter/php_functions.c +++ b/sapi/apache2filter/php_functions.c @@ -38,7 +38,7 @@ static request_rec *php_apache_lookup_uri(INTERNAL_FUNCTION_PARAMETERS) { zval **p1; php_struct *ctx; - SLS_FETCH(); + TSRMLS_FETCH(); if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE) return NULL; @@ -110,7 +110,7 @@ PHP_FUNCTION(get_all_headers) php_struct *ctx; apr_array_header_t *arr; char *key, *val; - SLS_FETCH(); + TSRMLS_FETCH(); if (array_init(return_value) == FAILURE) { RETURN_FALSE; diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 03a2ed90b9..8d47b8a29f 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -50,7 +50,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length) apr_bucket_brigade *bb; php_struct *ctx; uint now; - SLS_FETCH(); + TSRMLS_FETCH(); ctx = SG(server_context); @@ -72,7 +72,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length) } static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers SLS_DC) +php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) { php_struct *ctx = SG(server_context); char *val; @@ -100,7 +100,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str } static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC) +php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { php_struct *ctx = SG(server_context); @@ -110,7 +110,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC) } static int -php_apache_sapi_read_post(char *buf, uint count_bytes SLS_DC) +php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) { int n; int to_read; @@ -131,7 +131,7 @@ php_apache_sapi_read_post(char *buf, uint count_bytes SLS_DC) } static char * -php_apache_sapi_read_cookies(SLS_D) +php_apache_sapi_read_cookies(TSRMLS_D) { php_struct *ctx = SG(server_context); const char *http_cookie; @@ -143,7 +143,7 @@ php_apache_sapi_read_cookies(SLS_D) } static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC) +php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC TSRMLS_DC TSRMLS_DC) { php_struct *ctx = SG(server_context); apr_array_header_t *arr = apr_table_elts(ctx->f->r->subprocess_env); @@ -151,10 +151,10 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_D APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) val = empty_string; - php_register_variable(key, val, track_vars_array TSRMLS_CC PLS_CC); + php_register_variable(key, val, track_vars_array TSRMLS_CC); APR_ARRAY_FOREACH_CLOSE() - php_register_variable("PHP_SELF", ctx->f->r->uri, track_vars_array TSRMLS_CC PLS_CC); + php_register_variable("PHP_SELF", ctx->f->r->uri, track_vars_array TSRMLS_CC); } static void @@ -180,7 +180,7 @@ php_apache_sapi_flush(void *server_context) static void php_apache_sapi_log_message(char *msg) { php_struct *ctx; - SLS_FETCH(); + TSRMLS_FETCH(); ctx = SG(server_context); @@ -239,7 +239,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, const char *str; apr_ssize_t n; apr_status_t rv; - SLS_FETCH(); + TSRMLS_FETCH(); ctx = SG(server_context); @@ -261,13 +261,12 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, return APR_SUCCESS; } -static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx SLS_DC) +static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) { char *content_type; const char *auth; - CLS_FETCH(); TSRMLS_FETCH(); - PLS_FETCH(); + TSRMLS_FETCH(); PG(during_request_startup) = 0; SG(sapi_headers).http_response_code = 200; @@ -278,7 +277,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx SLS_DC) SG(request_info).request_method = f->r->method; SG(request_info).request_uri = safe_strdup(f->r->uri); f->r->no_local_copy = 1; - content_type = sapi_get_default_content_type(SLS_C); + content_type = sapi_get_default_content_type(TSRMLS_C); f->r->content_type = apr_pstrdup(f->r->pool, content_type); SG(request_info).post_data = ctx->post_data; SG(request_info).post_data_length = ctx->post_len; @@ -289,12 +288,12 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx SLS_DC) apr_table_unset(f->r->headers_out, "ETag"); apr_table_unset(f->r->headers_in, "Connection"); auth = apr_table_get(f->r->headers_in, "Authorization"); - php_handle_auth_data(auth SLS_CC); + php_handle_auth_data(auth TSRMLS_CC); - php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC); + php_request_startup(TSRMLS_C); } -static void php_apache_request_dtor(ap_filter_t *f SLS_DC) +static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC) { php_request_shutdown(NULL); @@ -309,7 +308,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) php_struct *ctx; apr_bucket *b; void *conf = ap_get_module_config(f->r->per_dir_config, &php4_module); - SLS_FETCH(); + TSRMLS_FETCH(); ctx = SG(server_context); INIT_CTX; @@ -327,7 +326,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) ctx->state++; - php_apache_request_ctor(f, ctx SLS_CC); + php_apache_request_ctor(f, ctx TSRMLS_CC); } /* moves all buckets from bb to ctx->bb */ @@ -339,9 +338,8 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) if (ctx->state == 1 && APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(ctx->bb))) { zend_file_handle zfd; apr_bucket *eos; - CLS_FETCH(); TSRMLS_FETCH(); - PLS_FETCH(); + TSRMLS_FETCH(); /* We want to execute only one script per request. * A bug in Apache or other filters could cause us @@ -351,7 +349,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) ctx->state = 2; /* Handle phpinfo/phpcredits/built-in images */ - if (!php_handle_special_queries(SLS_C PLS_CC)) { + if (!php_handle_special_queries(TSRMLS_C)) { b = APR_BRIGADE_FIRST(ctx->bb); @@ -365,7 +363,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) zfd.free_filename = 0; zfd.opened_path = NULL; - php_execute_script(&zfd CLS_CC TSRMLS_CC PLS_CC); + php_execute_script(&zfd TSRMLS_CC); } else { #define NO_DATA "The PHP Filter did not receive suitable input data" @@ -375,7 +373,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) } } - php_apache_request_dtor(f SLS_CC); + php_apache_request_dtor(f TSRMLS_CC); SG(server_context) = 0; /* Pass EOS bucket to next filter to signal end of request */ |
