cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c
costin 01/12/06 14:50:25 Modified:jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c Log: Update for the interface changes. Various fixes Update the code the initialize jk. Revision ChangesPath 1.4 +3 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c Index: jk_logger_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_logger_apache2.c 2001/12/05 20:49:48 1.3 +++ jk_logger_apache2.c 2001/12/06 22:50:25 1.4 @@ -85,7 +85,8 @@ #define HUGE_BUFFER_SIZE (8*1024) -int JK_METHOD jk_logger_apache2_factory(jk_env_t *env, void **result, +int JK_METHOD jk_logger_apache2_factory(jk_env_t *env, jk_pool_t *pool, +void **result, char *type, char *name); @@ -162,6 +163,7 @@ int jk_logger_apache2_factory(jk_env_t *env, + jk_pool_t *pool, void **result, char *type, char *name) 1.3 +37 -28 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_pool_apr.c Index: jk_pool_apr.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_pool_apr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_pool_apr.c 2001/12/05 20:49:48 1.2 +++ jk_pool_apr.c 2001/12/06 22:50:25 1.3 @@ -66,26 +66,27 @@ #include apr_pools.h #include apr_strings.h -int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent ); +int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent, apr_pool_t *aprPool ); -int JK_METHOD jk_pool_apr_factory(jk_env_t *env, void **result, +int JK_METHOD jk_pool_apr_factory(jk_env_t *env, + jk_pool_t *pool, + void **result, char *type, char *name); -void jk_pool_apr_open(jk_pool_t *_this, apr_pool_t *realPool ); - - -/** Nothing - apache will take care +/** Nothing - apache will take care ?? */ -static void jk_close_pool(jk_pool_t *p) +static void jk_pool_apr_close(jk_pool_t *p) { + } /** Nothing - apache will take care. XXX with jk pools we can implement 'recycling', not sure what's the equivalent for apache */ -static void jk_reset_pool(jk_pool_t *p) +static void jk_pool_apr_reset(jk_pool_t *p) { +apr_pool_clear(p-_private); } static void *jk_pool_apr_calloc(jk_pool_t *p, @@ -96,7 +97,7 @@ } static void *jk_pool_apr_alloc(jk_pool_t *p, - size_t size) + size_t size) { return apr_palloc( (apr_pool_t *)p-_private, (apr_size_t)size); } @@ -128,41 +129,49 @@ -/* Not implemented yet */ -int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent ) { +static jk_pool_t *jk_pool_apr_createChild( jk_pool_t *_this, int sizeHint ) { +apr_pool_t *parentAprPool=_this-_private; +apr_pool_t *childAprPool; +jk_pool_t *newPool; -return JK_TRUE; +apr_pool_create( childAprPool, parentAprPool ); + +jk_pool_apr_create( newPool, _this, childAprPool ); + +return newPool; } + + +int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent, apr_pool_t *aprPool) +{ +jk_pool_t *_this=(jk_pool_t *)apr_palloc(aprPool, sizeof( jk_pool_t )); + +_this-_private=aprPool; + +*newPool = _this; -static void init_methods(jk_pool_t *_this ) { -_this-open=jk_open_pool; -_this-close=jk_close_pool; -_this-reset=jk_reset_pool; +/* methods */ +_this-create=jk_pool_apr_createChild; +_this-close=jk_pool_apr_close; +_this-reset=jk_pool_apr_reset; _this-alloc=jk_pool_apr_alloc; _this-calloc=jk_pool_apr_calloc; _this-pstrdup=jk_pool_apr_strdup; _this-realloc=jk_pool_apr_realloc; + +return JK_TRUE; } /* Not used yet */ -int JK_METHOD jk_pool_apr_factory(jk_env_t *env, void **result, - char *type, char *name) +int JK_METHOD jk_pool_apr_factory(jk_env_t *env, jk_pool_t *pool, + void **result, + char *type, char *name) { jk_pool_t *_this=(jk_pool_t *)calloc( 1, sizeof(jk_pool_t)); -init_methods(_this ); - *result=_this; return JK_TRUE; -} - -/*
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c
costin 01/12/05 12:49:48 Modified:jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c Log: Few small fixes in apache logger and pool. Removed the old 'manual config' code, it'll be replaced with 'real' per_dir struct. Revision ChangesPath 1.3 +1 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c Index: jk_logger_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_logger_apache2.c 2001/12/04 19:11:56 1.2 +++ jk_logger_apache2.c 2001/12/05 20:49:48 1.3 @@ -152,7 +152,7 @@ if( buf[rc-1] == '\n' ) buf[rc-1]='\0'; -if( level = JK_LOG_ERROR ) { +if( level = JK_LOG_ERROR_LEVEL ) { ap_log_error( file, line, APLOG_EMERG | APLOG_NOERRNO, 0, s, buf); } else { ap_log_error( file, line, APLOG_DEBUG | APLOG_NOERRNO, 0, s, buf); 1.2 +11 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_pool_apr.c Index: jk_pool_apr.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_pool_apr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_pool_apr.c 2001/12/05 00:11:27 1.1 +++ jk_pool_apr.c 2001/12/05 20:49:48 1.2 @@ -64,7 +64,16 @@ #include jk_pool.h #include jk_env.h #include apr_pools.h +#include apr_strings.h +int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent ); + +int JK_METHOD jk_pool_apr_factory(jk_env_t *env, void **result, + char *type, char *name); + +void jk_pool_apr_open(jk_pool_t *_this, apr_pool_t *realPool ); + + /** Nothing - apache will take care */ static void jk_close_pool(jk_pool_t *p) @@ -112,10 +121,11 @@ } static void *jk_pool_apr_strdup(jk_pool_t *p, -const char *s) +const char *s) { return apr_pstrdup( (apr_pool_t *)p-_private, s); } + /* Not implemented yet */ 1.6 +8 -32 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mod_jk.c 2001/12/04 23:59:01 1.5 +++ mod_jk.c 2001/12/05 20:49:48 1.6 @@ -60,7 +60,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.5 $ * + * Version: $Revision: 1.6 $ * ***/ /* @@ -1124,46 +1124,22 @@ return DECLINED; workerEnv = (jk_workerEnv_t *)ap_get_module_config(r-server-module_config, - jk_module); -worker_name = apr_table_get(r-notes, JK_WORKER_ID); + jk_module); l = workerEnv-l; +worker_name = apr_table_get(r-notes, JK_WORKER_ID); + /* Set up r-read_chunked flags for chunked encoding, if present */ if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) { return rc; } if( worker_name == NULL ) { - /* we may be here because of a manual directive ( that overrides - translate and - sets the handler directly ). We still need to know the worker. - */ - if( workerEnv-num_of_workers == 1 ) { - /** We have a single worker ( the common case ). - ( lb is a bit special, it should count as a single worker but - I'm not sure how ). We also have a manual config directive that - explicitely give control to us. */ - worker = workerEnv-defaultWorker; - worker_name=worker-name; - l-jkLog(l, JK_LOG_DEBUG, +/* SetHandler case - per_dir config should have the worker*/ +worker = workerEnv-defaultWorker; +worker_name=worker-name; +l-jkLog(l, JK_LOG_DEBUG, Default worker for %s %s\n, r-uri, worker-name); - } else { - jk_uriMap_t *uriMap=workerEnv-uriMap; - jk_uriEnv_t *uriEnv; - -