From 721b3c88ee960bd2d45a0006071308fe8f714532 Mon Sep 17 00:00:00 2001 From: konn Date: Wed, 16 Mar 2005 13:59:15 +0000 Subject: [PATCH] =?utf8?q?shm=E3=81=AE=EF=BC=92=E9=87=8D=E7=A2=BA=E4=BF=9D?= =?utf8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82=20Handler=E3=82=92=E8=BF=BD?= =?utf8?q?=E5=8A=A0=E3=80=82=20Apache2.0.53=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@11 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- src/chxj_specified_device.c | 7 ++++--- src/mod_chxj.c | 29 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/chxj_specified_device.c b/src/chxj_specified_device.c index e0f44d7f..92f38ba3 100644 --- a/src/chxj_specified_device.c +++ b/src/chxj_specified_device.c @@ -15,6 +15,7 @@ * limitations under the License. */ #include "mod_chxj.h" +#include "ap_regex.h" static device_table UNKNOWN_DEVICE = { NULL, "","UNKNOWN", CHXJ_SPEC_UNKNOWN, 0, 0,0,0,0,0,0,0, ""}; @@ -27,8 +28,8 @@ static device_table UNKNOWN_DEVICE = { device_table* chxj_specified_device(request_rec* r, const char* user_agent) { - regex_t *regexp; - regmatch_t match[10]; + ap_regex_t *regexp; + ap_regmatch_t match[10]; device_table *returnType = &UNKNOWN_DEVICE; device_table_list* dtl; device_table* dt; @@ -43,7 +44,7 @@ chxj_specified_device(request_rec* r, const char* user_agent) { continue; } - regexp = ap_pregcomp(r->pool, (const char*)dtl->pattern, REG_EXTENDED|REG_ICASE); + regexp = ap_pregcomp(r->pool, (const char*)dtl->pattern, AP_REG_EXTENDED|AP_REG_ICASE); if (regexp == NULL) { return returnType; diff --git a/src/mod_chxj.c b/src/mod_chxj.c index dbc9b67d..3a034b07 100644 --- a/src/mod_chxj.c +++ b/src/mod_chxj.c @@ -569,6 +569,7 @@ chxj_init_module_kill(void *data) { server_rec *base_server = (server_rec *)data; mod_chxj_global_config* conf; + void* param; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, base_server, "start chxj_init_module_kill()"); @@ -603,10 +604,9 @@ chxj_init_module_kill(void *data) } static mod_chxj_global_config* -chxj_global_config_create(server_rec* s) +chxj_global_config_create(apr_pool_t* pool, server_rec* s) { apr_status_t sts; - apr_pool_t *pool = s->process->pool; void* shm_segment; apr_size_t shm_segsize; int* shm; @@ -619,10 +619,9 @@ chxj_global_config_create(server_rec* s) apr_pool_userdata_get(¶m, CHXJ_MOD_CONFIG_KEY, pool); conf = (mod_chxj_global_config*)param; - apr_pool_cleanup_register(pool, s, chxj_init_module_kill, - chxj_init_module_kill); + apr_pool_cleanup_null); if (conf) { /*------------------------------------------------------------------------*/ @@ -701,13 +700,9 @@ chxj_init_module(apr_pool_t *p, apr_pool_t *ptemp, server_rec *s) { - mod_chxj_global_config* conf; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "start chxj_init_module()"); - conf = chxj_global_config_create(s); - ap_add_version_component(p, CHXJ_VERSION_PREFIX CHXJ_VERSION); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, @@ -725,11 +720,22 @@ chxj_config_server_create(apr_pool_t *p, server_rec *s) { mod_chxj_global_config *gc; - gc = chxj_global_config_create(s); + gc = chxj_global_config_create(p,s); return gc; } +static int chxj_convert_images(request_rec *r) +{ + ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r, "chxj_convert_images Yahoo!![%s]", r->the_request); + + if (strcasecmp(r->handler, "keitai-picture")) + { + return DECLINED; + } + return DECLINED; +} + /** * The hook is registered. * @@ -752,10 +758,7 @@ chxj_register_hooks(apr_pool_t *p) chxj_input_filter, NULL, AP_FTYPE_RESOURCE); -#if 0 - AP_FTYPE_CONNECTION); - AP_FTYPE_PROTOCOL); -#endif + ap_hook_handler(chxj_convert_images, NULL, NULL, APR_HOOK_MIDDLE); } /** -- 2.11.0