tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c
Date Thu, 06 Dec 2001 22:50:25 GMT
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  Changes    Path
  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;
  -}
  -
  -/* that's what jk use to create pools. Deprecated! */
  -void jk_pool_apr_open(jk_pool_t *_this,
  -                      apr_pool_t *realPool )
  -{
  -    _this->_private=realPool;
  -    init_methods( _this );
   }
   
   
  
  
  
  1.7       +201 -188  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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_jk.c	2001/12/05 20:49:48	1.6
  +++ mod_jk.c	2001/12/06 22:50:25	1.7
  @@ -1,4 +1,3 @@
  -/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */
   /* ========================================================================= *
    *                                                                           *
    *                 The Apache Software License,  Version 1.1                 *
  @@ -60,7 +59,7 @@
    * Description: Apache 2 plugin for Jakarta/Tomcat                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    *                 Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.6 $                                           *
  + * Version:     $Revision: 1.7 $                                           *
    ***************************************************************************/
   
   /*
  @@ -96,13 +95,14 @@
   #include "jk_worker.h"
   #include "jk_workerEnv.h"
   #include "jk_uriMap.h"
  +#include "jk_requtil.h"
   
   #define JK_WORKER_ID        ("jakarta.worker")
   #define JK_HANDLER          ("jakarta-servlet")
   #define JK_MAGIC_TYPE       ("application/x-jakarta-servlet")
   #define NULL_FOR_EMPTY(x)   ((x && !strlen(x)) ? NULL : x) 
   
  -AP_MODULE_DECLARE_DATA module jk_module;
  +module AP_MODULE_DECLARE_DATA jk_module;
   
   
   static int JK_METHOD ws_start_response(jk_ws_service_t *s,
  @@ -465,7 +465,7 @@
           }
   
           if(workerEnv->envvars_in_use) {
  -            apr_array_header_t *t = apr_table_elts(workerEnv->envvars);
  +            const apr_array_header_t *t = apr_table_elts(workerEnv->envvars);
               if(t && t->nelts) {
                   int i;
                   apr_table_entry_t *elts = (apr_table_entry_t *)t->elts;
  @@ -493,7 +493,7 @@
       s->num_headers      = 0;
       if(r->headers_in && apr_table_elts(r->headers_in)) {
           int need_content_length_header = (!s->is_chunked && s->content_length
== 0) ? JK_TRUE : JK_FALSE;
  -        apr_array_header_t *t = apr_table_elts(r->headers_in);
  +        const apr_array_header_t *t = apr_table_elts(r->headers_in);
           if(t && t->nelts) {
               int i;
               apr_table_entry_t *elts = (apr_table_entry_t *)t->elts;
  @@ -895,9 +895,9 @@
    *  ForwardURIEscaped       => Forward URI escaped and Tomcat (3.3 rc2) stuff will do
the decoding part
    */
   
  -const char *jk_set_options(cmd_parms *cmd,
  -                           void *dummy,
  -                           const char *line)
  +static const char *jk_set_options(cmd_parms *cmd,
  +                                  void *dummy,
  +                                  const char *line)
   {
       int  opt = 0;
       int  mask = 0;
  @@ -1058,7 +1058,7 @@
           "JkCERTSIndicator", jk_set_certs_indicator, NULL, RSRC_CONF,
           "Name of the Apache environment that contains SSL client certificates"),
       AP_INIT_TAKE1(
  -        "JkCIPHERIndicator", jk_set_cipher_indicator, NULL, RSRC_CONF,
  +         "JkCIPHERIndicator", jk_set_cipher_indicator, NULL, RSRC_CONF,
           "Name of the Apache environment that contains SSL client cipher"),
       AP_INIT_TAKE1(
           "JkSESSIONIndicator", jk_set_session_indicator, NULL, RSRC_CONF,
  @@ -1095,146 +1095,6 @@
       {NULL}
   };
   
  -
  -
  -/* ========================================================================= */
  -/* The JK module handlers                                                    */
  -/* ========================================================================= */
  -
  -/** Util - cleanup endpoint.
  - */
  -apr_status_t jk_cleanup_endpoint( void *data ) {
  -    jk_endpoint_t *end = (jk_endpoint_t *)data;    
  -    /*     printf("XXX jk_cleanup1 %ld\n", data); */
  -    end->done(&end, NULL);  
  -    return 0;
  -}
  -
  -/** Main service method, called to forward a request to tomcat
  - */
  -static int jk_handler(request_rec *r)
  -{   
  -    const char       *worker_name;
  -    jk_logger_t      *l;
  -    jk_workerEnv_t *workerEnv;
  -    int              rc;
  -    jk_worker_t *worker;
  -
  -    if(strcmp(r->handler,JK_HANDLER))    /* not for me, try next handler */
  -      return DECLINED;
  -
  -    workerEnv = (jk_workerEnv_t *)ap_get_module_config(r->server->module_config,

  -                                                       &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 ) {
  -        /* 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); 
  -    }
  -
  -    if (1) {
  -        l->jkLog(l, JK_LOG_DEBUG, "Into handler r->proxyreq=%d "
  -               "r->handler=%s r->notes=%d worker=%s\n", 
  -               r->proxyreq, r->handler, r->notes, worker_name); 
  -    }
  -
  -    /* If this is a proxy request, we'll notify an error */
  -    if(r->proxyreq) {
  -        return HTTP_INTERNAL_SERVER_ERROR;
  -    }
  -
  -    if(worker_name!=NULL || worker!=NULL ) {
  -        if( worker==NULL ) {
  -            worker = workerEnv->getWorkerForName(workerEnv,
  -                                                 worker_name );
  -        }
  -
  -        if(worker) {
  -            int rc = JK_FALSE;
  -            jk_pool_t p;
  -            jk_ws_service_t s;
  -            jk_pool_atom_t buf[SMALL_POOL_SIZE];
  -            jk_open_pool(&p, buf, sizeof(buf));
  -            
  -            s.workerEnv=workerEnv;
  -            s.response_started = JK_FALSE;
  -            s.read_body_started = JK_FALSE;
  -            
  -            jk_requtil_initRequest(&s);
  -
  -            s.ws_private = r;
  -            s.pool = &p;            
  -            
  -            if(init_ws_service(&s, workerEnv)) {
  -                jk_endpoint_t *end = NULL;
  -
  -                /* Use per/thread pool ( or "context" ) to reuse the 
  -                   endpoint. It's a bit faster, but I don't know 
  -                   how to deal with load balancing - but it's usefull for JNI
  -                */
  -                
  -                if( workerEnv->perThreadWorker ) {
  -                    apr_pool_t *rpool=r->pool;
  -                    apr_pool_t *parent_pool= apr_pool_get_parent( rpool );
  -                    apr_pool_t *tpool= apr_pool_get_parent( parent_pool );
  -        
  -                    apr_pool_userdata_get( (void *)&end, "jk_thread_endpoint", tpool
);
  -                    l->jkLog(l, JK_LOG_DEBUG, "Using per-thread worker %lx\n ", end
);
  -                    if(end==NULL ) {
  -                        worker->get_endpoint(worker, &end, l);
  -                        apr_pool_userdata_set( end , "jk_thread_endpoint", 
  -                                               &jk_cleanup_endpoint,  tpool );
  -                    }
  -                } else {
  -                    worker->get_endpoint(worker, &end, l);
  -                }
  -                {   
  -                    int is_recoverable_error = JK_FALSE;
  -                    rc = end->service(end, &s, l, &is_recoverable_error);
  -                    
  -                    if (s.content_read < s.content_length ||
  -                        (s.is_chunked && ! s.no_more_chunks)) {
  -                        
  -                        /*
  -                         * If the servlet engine didn't consume all of the
  -                         * request data, consume and discard all further
  -                         * characters left to read from client
  -                         */
  -                        char *buff = apr_palloc(r->pool, 2048);
  -                        if (buff != NULL) {
  -                            int rd;
  -                            while ((rd = ap_get_client_block(r, buff, 2048)) > 0) {
  -                                s.content_read += rd;
  -                            }
  -                        }
  -                    }
  -                }
  -                if( ! workerEnv->perThreadWorker ) {
  -                    end->done(&end, l); 
  -                }
  -            }
  -
  -            p.close(&p);
  -            
  -            if(rc) {
  -                return OK;    /* NOT r->status, even if it has changed. */
  -            }
  -        }
  -    }
  -
  -    return DECLINED;
  -}
  -
   static void *create_jk_dir_config(apr_pool_t *p, char *dummy)
   {
       jk_uriEnv_t *new =
  @@ -1245,7 +1105,7 @@
   }
   
   
  -static void *merge_jk_dir_configs(apr_pool_t *p, void *basev, void *addv)
  +static void *merge_jk_dir_config(apr_pool_t *p, void *basev, void *addv)
   {
       jk_uriEnv_t *base =(jk_uriEnv_t *)basev;
       jk_uriEnv_t *add = (jk_uriEnv_t *)addv;
  @@ -1256,6 +1116,12 @@
       return add;
   }
   
  +int jk_logger_apache2_factory(jk_env_t *env,
  +                              jk_pool_t *pool,
  +                              void **result,
  +                              char *type,
  +                              char *name);
  +
   /** Create default jk_config. XXX This is mostly server-independent,
       all servers are using something similar - should go to common.
   
  @@ -1265,56 +1131,61 @@
   {
       /* XXX Do we need both env and workerEnv ? */
       jk_env_t *env;
  -    jk_env_objectFactory_t fac;
       jk_workerEnv_t *workerEnv;
       jk_logger_t *l;
  -        
  -    env=jk_env_getEnv( NULL );
  +    jk_pool_t *globalPool;
  +    jk_pool_t *workerEnvPool;
   
  -    /*     l = env->getInstance( env, "logger", "file"); */
  -    jk_logger_apache2_factory( env, &l, "logger", "file");
  +    /** First create a pool
  +     */
  +#ifdef NO_APACHE_POOL
  +    jk_pool_create( &globalPool, NULL, 2048 );
  +#else
  +    jk_pool_apr_create( &globalPool, NULL, p );
  +#endif
  +
  +    /** Create the global environment. This will register the default
  +        factories
  +    */
  +    env=jk_env_getEnv( NULL, globalPool );
  +
  +    /* Optional. Register more factories ( or replace existing ones ) */
  +
  +
  +    /* Init the environment. */
  +    
  +    /* Create the logger */
  +#ifdef NO_APACHE_LOGGER
  +    l = env->getInstance( env, env->globalPool, "logger", "file");
  +#else
  +    jk_logger_apache2_factory( env, env->globalPool, &l, "logger", "file");
       l->logger_private=s;
  +#endif
       
       env->logger=l;
       
       l->jkLog(l, JK_LOG_DEBUG, "Created env and logger\n" );
   
  -    workerEnv= env->getInstance( env, "workerEnv", "default");
  +    /* Create the workerEnv */
  +    workerEnvPool=
  +        env->globalPool->create( env->globalPool, HUGE_POOL_SIZE );
  +    
  +    workerEnv= env->getInstance( env,
  +                                 workerEnvPool,
  +                                 "workerEnv", "default");
   
       if( workerEnv==NULL ) {
  -        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 
  -                     NULL, "Error creating workerEnv\n"  );
  +        l->jkLog(l, JK_LOG_ERROR, "Error creating workerEnv\n");
           return NULL;
       }
   
       /* Local initialization */
       workerEnv->_private = s;
   
  +    printf("XXX Create jk config\n");
       return workerEnv;
   }
   
  -
  -/** Utility - copy a map . XXX Should move to jk_map, it's generic code.
  - */
  -static void copy_jk_map(apr_pool_t *p, server_rec * s, jk_map_t * src, 
  -                        jk_map_t * dst)
  -{   
  -    int sz = map_size(src);
  -        int i;
  -        for(i = 0 ; i < sz ; i++) {
  -            void *old;
  -            char *name = map_name_at(src, i);
  -            if(map_get(src, name, NULL) == NULL) {
  -                if(!map_put(dst, name, 
  -                            apr_pstrdup(p, map_get_string(src, name, NULL)), 
  -                            &old)) {
  -                    jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, 
  -                                  "Memory error");
  -                }
  -            } 
  -        }
  -}
  -
   /** Standard apache callback, merge jk options specified in 
       <Host> context. Used to set per virtual host configs
    */
  @@ -1324,7 +1195,7 @@
   {
       jk_workerEnv_t *base = (jk_workerEnv_t *) basev;
       jk_workerEnv_t *overrides = (jk_workerEnv_t *)overridesv;
  -
  +    
   
       /* XXX Commented out for now. It'll be reimplemented after we
          add per/dir config and merge. 
  @@ -1373,11 +1244,12 @@
   /** Standard apache callback, initialize jk.
    */
   static void jk_child_init(apr_pool_t *pconf, 
  -              server_rec *s)
  +                          server_rec *s)
   {
       jk_workerEnv_t *workerEnv =
           (jk_workerEnv_t *)ap_get_module_config(s->module_config, &jk_module);
   
  +    printf("XXX Child init ");
       /* init_jk( pconf, conf, s );  do we need jk_child_init? For ajp14? */
     }
   
  @@ -1416,6 +1288,7 @@
                              apr_pool_t *ptemp, 
                              server_rec *s)
   {
  +    printf("XXX postConfig");
       if(!s->is_virtual) {
           jk_workerEnv_t *workerEnv =
               (jk_workerEnv_t *)ap_get_module_config(s->module_config, 
  @@ -1428,6 +1301,146 @@
       return OK;
   }
   
  +/* ========================================================================= */
  +/* The JK module handlers                                                    */
  +/* ========================================================================= */
  +
  +/** Util - cleanup endpoint. Used with per/thread endpoints.
  + */
  +static apr_status_t jk_cleanup_endpoint( void *data ) {
  +    jk_endpoint_t *end = (jk_endpoint_t *)data;    
  +    printf("XXX jk_cleanup1 %p\n", data); 
  +    end->done(&end, NULL);  
  +    return 0;
  +}
  +
  +/** Main service method, called to forward a request to tomcat
  + */
  +static int jk_handler(request_rec *r)
  +{   
  +    const char       *worker_name;
  +    jk_logger_t      *l;
  +    jk_workerEnv_t *workerEnv;
  +    int              rc;
  +    jk_worker_t *worker=NULL;
  +    jk_endpoint_t *end = NULL;
  +
  +    if(strcmp(r->handler,JK_HANDLER))    /* not for me, try next handler */
  +      return DECLINED;
  +
  +    workerEnv = (jk_workerEnv_t *)ap_get_module_config(r->server->module_config,

  +                                                       &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 ) {
  +        /* 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); 
  +    }
  +
  +    if (1) {
  +        l->jkLog(l, JK_LOG_DEBUG, "Into handler r->proxyreq=%d "
  +               "r->handler=%s r->notes=%d worker=%s\n", 
  +               r->proxyreq, r->handler, r->notes, worker_name); 
  +    }
  +
  +    /* If this is a proxy request, we'll notify an error */
  +    if(r->proxyreq) {
  +        return HTTP_INTERNAL_SERVER_ERROR;
  +    }
  +
  +    if(worker_name==NULL && worker==NULL )
  +        return DECLINED;
  +
  +    if( worker==NULL ) {
  +        worker = workerEnv->getWorkerForName(workerEnv,
  +                                             worker_name );
  +    }
  +
  +    if(worker==NULL)
  +        return DECLINED;
  +
  +    /* Find the endpoint */
  +    
  +    /* Use per/thread pool ( or "context" ) to reuse the 
  +       endpoint. It's a bit faster, but I don't know 
  +       how to deal with load balancing - but it's usefull for JNI
  +    */
  +    
  +    if( workerEnv->perThreadWorker ) {
  +        apr_pool_t *rpool=r->pool;
  +        apr_pool_t *parent_pool= apr_pool_get_parent( rpool );
  +        apr_pool_t *tpool= apr_pool_get_parent( parent_pool );
  +        
  +        apr_pool_userdata_get( (void *)&end, "jk_thread_endpoint", tpool );
  +        l->jkLog(l, JK_LOG_DEBUG, "Using per-thread worker %lx\n ", end );
  +        if(end==NULL ) {
  +            worker->get_endpoint(worker, &end, l);
  +            apr_pool_userdata_set( end , "jk_thread_endpoint", 
  +                                   &jk_cleanup_endpoint,  tpool );
  +        }
  +    } else {
  +        worker->get_endpoint(worker, &end, l);
  +    }
  +
  +    {
  +        int rc = JK_FALSE;
  +        jk_ws_service_t sOnStack;
  +        jk_ws_service_t *s=&sOnStack;
  +        int is_recoverable_error = JK_FALSE;
  +        
  +        jk_requtil_initRequest(s);
  +
  +        s->workerEnv=workerEnv;
  +        s->response_started = JK_FALSE;
  +        s->read_body_started = JK_FALSE;
  +        s->ws_private = r;
  +        s->pool=end->pool;
  +        
  +        rc=init_ws_service(s, workerEnv);
  +        
  +        rc = end->service(end, s, l, &is_recoverable_error);
  +                    
  +        if (s->content_read < s->content_length ||
  +            (s->is_chunked && ! s->no_more_chunks)) {
  +            
  +            /*
  +             * If the servlet engine didn't consume all of the
  +             * request data, consume and discard all further
  +             * characters left to read from client
  +             */
  +            char *buff = apr_palloc(r->pool, 2048);
  +            if (buff != NULL) {
  +                int rd;
  +                while ((rd = ap_get_client_block(r, buff, 2048)) > 0) {
  +                    s->content_read += rd;
  +                }
  +            }
  +        }
  +    }
  +
  +    end->pool->reset(end->pool);
  +    
  +    if( ! workerEnv->perThreadWorker ) {
  +        end->done(&end, l); 
  +    }
  +
  +    if(rc) {
  +        return OK;    /* NOT r->status, even if it has changed. */
  +    }
  +
  +    return DECLINED;
  +}
  +
   /** Use the internal mod_jk mappings to find if this is a request for
    *    tomcat and what worker to use. 
    */
  @@ -1478,9 +1491,9 @@
       /* Why do we need to duplicate a constant ??? */
       r->handler=apr_pstrdup(r->pool,JK_HANDLER);
   
  -    apr_table_setn(r->notes, JK_WORKER_ID, uriEnv->worker->name);
  +    apr_table_setn(r->notes, JK_WORKER_ID, uriEnv->webapp->worker->name);
       l->jkLog(l, JK_LOG_DEBUG, 
  -             "mod_jk: map %s %s\n", r->uri, uriEnv->worker->name);
  +             "mod_jk: map %s %s\n", r->uri, uriEnv->webapp->worker->name);
   
       /* XXXX XXXX
          Use request_config -> it's much cheaper then notes !!!
  @@ -1533,11 +1546,11 @@
   module AP_MODULE_DECLARE_DATA jk_module =
   {
       STANDARD20_MODULE_STUFF,
  -    NULL,                /* dir config creater */
  -    NULL,                /* dir merger --- default is to override */
  +    NULL ,/*     create_jk_dir_config dir config creater */
  +    NULL, /* merge_jk_dir_config dir merger --- default is to override */
       create_jk_config,    /* server config */
  -    merge_jk_config,    /* merge server config */
  -    jk_cmds,            /* command ap_table_t */
  +    merge_jk_config,     /* merge server config */
  +    jk_cmds,             /* command ap_table_t */
       jk_register_hooks    /* register hooks */
   };
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message