From 7ba7bd0999fb88177a249066081f89fb88ab3bee Mon Sep 17 00:00:00 2001 From: Daniel Smertnig Date: Wed, 7 Dec 2005 22:19:34 +0100 Subject: [PATCH] Fastcgi module for Apache 2.2 OK, after some investigation I found out that the "new" (apr_*) symbols were introduced beginning with 2.0 and that the older symbols were defines were dropped. Therefore I believe the simplest/shortest way to make mod_fastcgi work with 1.3, 2.0 and 2.2 is to reintroduce these defines ourselves when necessary. The attached patch does this and additionaly fixes a problem in Makefile.AP2 under 2.2 (still works under 2.0 though). It was tested on 1.3.33, 2.0.55 and 2.2 and compiles and loads on all three versions. I believe it is suitable for inclusion in the official code base. --- Makefile.AP2 | 2 -- fcgi.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Makefile.AP2 b/Makefile.AP2 index dee94c7..c2c8917 100644 --- a/Makefile.AP2 +++ b/Makefile.AP2 @@ -20,8 +20,6 @@ APACHECTL = apachectl all: local-shared-build -install: install-modules - clean: -rm -f *.o *.lo *.slo *.la diff --git a/fcgi.h b/fcgi.h index aa23e20..44c13b0 100644 --- a/fcgi.h +++ b/fcgi.h @@ -73,6 +73,36 @@ typedef apr_status_t apcb_t; #define ap_reset_timeout(a) #define ap_unblock_alarms() +/* starting with apache 2.2 the backward-compatibility defines for + * 1.3 APIs are not available anymore. Define them ourselves here. + */ +#ifndef ap_copy_table + +#define ap_copy_table apr_table_copy +#define ap_cpystrn apr_cpystrn +#define ap_destroy_pool apr_pool_destroy +#define ap_isspace apr_isspace +#define ap_make_array apr_array_make +#define ap_make_table apr_table_make +#define ap_null_cleanup apr_pool_cleanup_null +#define ap_palloc apr_palloc +#define ap_pcalloc apr_pcalloc +#define ap_psprintf apr_psprintf +#define ap_pstrcat apr_pstrcat +#define ap_pstrdup apr_pstrdup +#define ap_pstrndup apr_pstrndup +#define ap_push_array apr_array_push +#define ap_register_cleanup apr_pool_cleanup_register +#define ap_snprintf apr_snprintf +#define ap_table_add apr_table_add +#define ap_table_do apr_table_do +#define ap_table_get apr_table_get +#define ap_table_set apr_table_set +#define ap_table_setn apr_table_setn +#define ap_table_unset apr_table_unset + +#endif /* defined(ap_copy_table) */ + #if (defined(HAVE_WRITEV) && !HAVE_WRITEV && !defined(NO_WRITEV)) || defined WIN32 #define NO_WRITEV #endif -- 2.11.4.GIT