From: Sascha Schumann Date: Wed, 28 Feb 2001 14:03:58 +0000 (+0000) Subject: Make the module compile again with the latest httpd-2.0 cvs. X-Git-Tag: php-4.0.5RC1~138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ed0cbb140d143913efe8711045cd25e0dd48152;p=php Make the module compile again with the latest httpd-2.0 cvs. --- diff --git a/sapi/apache2filter/README b/sapi/apache2filter/README index 847f29e14d..0d4e74b259 100644 --- a/sapi/apache2filter/README +++ b/sapi/apache2filter/README @@ -36,8 +36,8 @@ HOW TO INSTALL At the end of conf/httpd.conf, add: - AddOutputFilter PHP - AddInputFilter PHP + SetOutputFilter PHP + SetInputFilter PHP That's it. Now start bin/httpd. diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index c300c86557..20fcf50a09 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -62,12 +62,12 @@ static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, str_len = strlen(name); - if (zend_hash_find(&d->config, name, str_len + 1, (void **) &pe) == SUCCESS) { + if (zend_hash_find(&d->config, (char *) name, str_len + 1, (void **) &pe) == SUCCESS) { if (pe->status > status) return NULL; } - zend_hash_update(&d->config, name, strlen(name) + 1, &e, sizeof(e), + zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL); return NULL; } diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 index 7ffce4f296..fe81e2e9a5 100644 --- a/sapi/apache2filter/config.m4 +++ b/sapi/apache2filter/config.m4 @@ -28,7 +28,6 @@ AC_ARG_WITH(apxs2, APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` APXS_CFLAGS=`$APXS -q CFLAGS` AC_ADD_INCLUDE($APXS_INCLUDEDIR) - AC_ADD_INCLUDE($APXS_INCLUDEDIR/apr) if `echo $APXS_CFLAGS|grep USE_HSREGEX>/dev/null`; then APACHE_HAS_REGEX=yes fi diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h index 6faf583242..101c81430b 100644 --- a/sapi/apache2filter/php_apache.h +++ b/sapi/apache2filter/php_apache.h @@ -21,7 +21,7 @@ typedef struct php_struct { int state; - ap_bucket_brigade *bb; + apr_bucket_brigade *bb; ap_filter_t *f; /* Length of post_data buffer */ int post_len; diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index f184bbaea2..88c10dee3c 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -46,8 +46,8 @@ static int php_apache_sapi_ub_write(const char *str, uint str_length) { - ap_bucket *b; - ap_bucket_brigade *bb; + apr_bucket *b; + apr_bucket_brigade *bb; php_struct *ctx; uint now; SLS_FETCH(); @@ -56,10 +56,10 @@ php_apache_sapi_ub_write(const char *str, uint str_length) if (!str_length) return 0; - bb = ap_brigade_create(ctx->f->r->pool); + bb = apr_brigade_create(ctx->f->r->pool); while (str_length > 0) { now = MIN(str_length, 4096); - b = ap_bucket_create_transient(str, now); + b = apr_bucket_transient_create(str, now); AP_BRIGADE_INSERT_TAIL(bb, b); str += now; str_length -= now; @@ -161,16 +161,16 @@ static void php_apache_sapi_flush(void *server_context) { php_struct *ctx = server_context; - ap_bucket_brigade *bb; - ap_bucket *b; + apr_bucket_brigade *bb; + apr_bucket *b; /* Send a flush bucket down the filter chain. The current default * handler seems to act on the first flush bucket, but ignores * all further flush buckets. */ - bb = ap_brigade_create(ctx->f->r->pool); - b = ap_bucket_create_flush(); + bb = apr_brigade_create(ctx->f->r->pool); + b = apr_bucket_flush_create(); AP_BRIGADE_INSERT_TAIL(bb, b); if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) { php_handle_aborted_connection(); @@ -221,21 +221,21 @@ static sapi_module_struct apache2_sapi_module = { }; -module MODULE_VAR_EXPORT php4_module; +AP_MODULE_DECLARE_DATA module php4_module; #define INIT_CTX \ if (ctx == NULL) { \ /* Initialize filter context */ \ SG(server_context) = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx)); \ - ctx->bb = ap_brigade_create(f->c->pool); \ + ctx->bb = apr_brigade_create(f->c->pool); \ } -static int php_input_filter(ap_filter_t *f, ap_bucket_brigade *bb, +static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, ap_input_mode_t mode) { php_struct *ctx; long old_index; - ap_bucket *b; + apr_bucket *b; const char *str; apr_ssize_t n; apr_status_t rv; @@ -249,8 +249,8 @@ static int php_input_filter(ap_filter_t *f, ap_bucket_brigade *bb, return rv; } - AP_BRIGADE_FOREACH(b, bb) { - ap_bucket_read(b, &str, &n, 1); + APR_BRIGADE_FOREACH(b, bb) { + apr_bucket_read(b, &str, &n, 1); if (n > 0) { old_index = ctx->post_len; ctx->post_len += n; @@ -304,10 +304,10 @@ static void php_apache_request_dtor(ap_filter_t *f SLS_DC) safe_free(SG(request_info).request_uri); } -static int php_output_filter(ap_filter_t *f, ap_bucket_brigade *bb) +static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) { php_struct *ctx; - ap_bucket *b; + apr_bucket *b; apr_status_t rv; const char *str; apr_ssize_t n; @@ -339,11 +339,11 @@ static int php_output_filter(ap_filter_t *f, ap_bucket_brigade *bb) /* If we have received all data from the previous filters, * we "flatten" the buckets by creating a single string buffer. */ - if (ctx->state == 1 && AP_BUCKET_IS_EOS(AP_BRIGADE_LAST(ctx->bb))) { + if (ctx->state == 1 && apr_bucket_IS_EOS(AP_BRIGADE_LAST(ctx->bb))) { int fd; zend_file_handle zfd; smart_str content = {0}; - ap_bucket *eos; + apr_bucket *eos; CLS_FETCH(); ELS_FETCH(); PLS_FETCH(); @@ -360,8 +360,8 @@ static int php_output_filter(ap_filter_t *f, ap_bucket_brigade *bb) goto ok; /* Loop over all buckets and put them into the buffer */ - AP_BRIGADE_FOREACH(b, ctx->bb) { - rv = ap_bucket_read(b, &str, &n, 1); + APR_BRIGADE_FOREACH(b, ctx->bb) { + rv = apr_bucket_read(b, &str, &n, 1); if (rv == APR_SUCCESS && n > 0) smart_str_appendl(&content, str, n); } @@ -400,14 +400,14 @@ static int php_output_filter(ap_filter_t *f, ap_bucket_brigade *bb) goto ok; skip_execution: #define NO_DATA "php_filter did not get ANY data" - eos = ap_bucket_create_transient(NO_DATA, sizeof(NO_DATA)-1); + eos = apr_bucket_transient_create(NO_DATA, sizeof(NO_DATA)-1); AP_BRIGADE_INSERT_HEAD(bb, eos); ok: php_apache_request_dtor(f SLS_CC); SG(server_context) = 0; /* Pass EOS bucket to next filter to signal end of request */ - eos = ap_bucket_create_eos(); + eos = apr_bucket_eos_create(); AP_BRIGADE_INSERT_TAIL(bb, eos); return ap_pass_brigade(f->next, bb); @@ -436,14 +436,14 @@ php_apache_server_startup(apr_pool_t *pchild, server_rec *s) php_apache_register_module(); } -static void php_register_hook(void) +static void php_register_hook(apr_pool_t *p) { - ap_hook_child_init(php_apache_server_startup, NULL, NULL, AP_HOOK_MIDDLE); + ap_hook_child_init(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); ap_register_output_filter("PHP", php_output_filter, AP_FTYPE_CONTENT); ap_register_input_filter("PHP", php_input_filter, AP_FTYPE_CONTENT); } -module MODULE_VAR_EXPORT php4_module = { +AP_MODULE_DECLARE_DATA module php4_module = { STANDARD20_MODULE_STUFF, create_php_config, /* create per-directory config structure */ merge_php_config, /* merge per-directory config structures */