]> granicus.if.org Git - php/commitdiff
Make the module compile again with the latest httpd-2.0 cvs.
authorSascha Schumann <sas@php.net>
Wed, 28 Feb 2001 14:03:58 +0000 (14:03 +0000)
committerSascha Schumann <sas@php.net>
Wed, 28 Feb 2001 14:03:58 +0000 (14:03 +0000)
sapi/apache2filter/README
sapi/apache2filter/apache_config.c
sapi/apache2filter/config.m4
sapi/apache2filter/php_apache.h
sapi/apache2filter/sapi_apache2.c

index 847f29e14d49082fba7c66562b8704942ca807b2..0d4e74b259fd009e82d9aa2e87ad88fbfbb6282a 100644 (file)
@@ -36,8 +36,8 @@ HOW TO INSTALL
     At the end of conf/httpd.conf, add:
 
         <Files *.php>
-        AddOutputFilter PHP
-        AddInputFilter PHP
+        SetOutputFilter PHP
+        SetInputFilter PHP
         </Files>
 
     That's it. Now start bin/httpd.
index c300c86557d5158d3a00a4fdff60de77faba4601..20fcf50a095f83f54598eceaea5e68cef90c80fd 100644 (file)
@@ -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;
 }
index 7ffce4f296dc5ecfbecfe0734432a58a3557f1ca..fe81e2e9a5d50013c09c8db882190cf908a3c002 100644 (file)
@@ -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
index 6faf5832425dbb270f6885f32b89d6354871af42..101c81430b9519e049ad6a6a89969d79bb5158c7 100644 (file)
@@ -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;
index f184bbaea2931bdebf9dbb790b1f54c8af903b89..88c10dee3c3ee9581300af7bf450b099cff4399f 100644 (file)
@@ -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 */