cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c

2004-02-09 Thread hgomez
hgomez  2004/02/09 04:01:22

  Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
  Log:
  Remove obsolete linefeeds from the logs, see the ap_log_* functions 
  dont need trailing linefeeds.
  
  Thanks to Gunter Knauf
  
  Revision  ChangesPath
  1.65  +9 -9  jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
  
  Index: mod_jk2.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- mod_jk2.c 30 Sep 2003 13:42:02 -  1.64
  +++ mod_jk2.c 9 Feb 2004 12:01:22 -   1.65
  @@ -141,7 +141,7 @@
   rc=workerEnv-config-setPropertyString( env, workerEnv-config, (char *)name, 
value );
   if (rc!=JK_OK) {
   ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool,
  -  mod_jk2: Unrecognized option %s %s\n, name, value);
  +  mod_jk2: Unrecognized option %s %s, name, value);
   }
   
   return NULL;
  @@ -164,14 +164,14 @@
   
   if( name == NULL || property==NULL || value==NULL ) {
   ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool,
  -  mod_jk2: Null option in JkSet2\n);
  +  mod_jk2: Null option in JkSet2);
   return NULL;
   }
   
   mbean=env-getBean( env, name );
   if( mbean==NULL ) {
   ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool,
  -  mod_jk2: Creating object %s\n, name );
  +  mod_jk2: Creating object %s, name );
   mbean=env-createBean( env, workerEnv-config-pool, (char *)name );
   }
   
  @@ -188,7 +188,7 @@
   
   if (rc!=JK_OK) {
   ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool,
  -  mod_jk2: Unrecognized option %s %s %s\n, name, property, 
value);
  +  mod_jk2: Unrecognized option %s %s %s, name, property, 
value);
   }
   
   return NULL;
  @@ -266,7 +266,7 @@
   /* now lets actually add the parameter set in the Location block */
   uriEnv-mbean-setAttribute( workerEnv-globalEnv, uriEnv-mbean, (char *)name, 
(void *)val );
   
  -/* fprintf(stderr, JkUriSet  %s %s dir=%s args=%s\n, */
  +/* fprintf(stderr, JkUriSet  %s %s dir=%s args=%s, */
   /* uriEnv-workerName, cmd-path, */
   /* cmd-directive-directive, */
   /* cmd-directive-args); */
  @@ -452,11 +452,11 @@
   if( s-is_virtual ) {
   /* Virtual host */
   ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p,
  -  mod_jk Create config for virtual host %s\n,
  +  mod_jk Create config for virtual host %s,
 s-server_hostname );
   } else {
   ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p,
  -  mod_jk Create config for default server %s\n,
  +  mod_jk Create config for default server %s,
 s-server_hostname );
   }
   
  @@ -483,7 +483,7 @@
   jk_uriEnv_t *overrides = (jk_uriEnv_t *)overridesv;
   
   ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p,
  -  mod_jk Merging workerEnv\n);
  +  mod_jk Merging workerEnv);
   
   
   /* The 'mountcopy' option should be implemented in common.
  
  
  
  1.39  +2 -2  
jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c
  
  Index: jk_service_apache2.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- jk_service_apache2.c  2 Feb 2004 18:23:55 -   1.38
  +++ jk_service_apache2.c  9 Feb 2004 12:01:22 -   1.39
  @@ -311,7 +311,7 @@
*/
   if(ap_rflush(rr) != APR_SUCCESS) {
   ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 
  - NULL, mod_jk: Error flushing \n  );
  + NULL, mod_jk: Error flushing  );
   return JK_ERR;
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c jk_map_aprtable.c jk_logger_apache2.c jk_apache2.h

2003-02-03 Thread mturk
mturk   2003/02/03 23:41:42

  Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
jk_map_aprtable.c jk_logger_apache2.c jk_apache2.h
  Log:
  Update license to 2003.
  
  Revision  ChangesPath
  1.58  +2 -2  jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
  
  Index: mod_jk2.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- mod_jk2.c 23 Jan 2003 12:11:54 -  1.57
  +++ mod_jk2.c 4 Feb 2003 07:41:41 -   1.58
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - *  Copyright (c) 1999-2002 The Apache Software Foundation.  *
  + *  Copyright (c) 1999-2003 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  
  
  
  1.34  +2 -2  
jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c
  
  Index: jk_service_apache2.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- jk_service_apache2.c  9 Dec 2002 13:23:19 -   1.33
  +++ jk_service_apache2.c  4 Feb 2003 07:41:41 -   1.34
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - *  Copyright (c) 1999-2002 The Apache Software Foundation.  *
  + *  Copyright (c) 1999-2003 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  
  
  
  1.11  +1 -1  
jakarta-tomcat-connectors/jk/native2/server/apache2/jk_map_aprtable.c
  
  Index: jk_map_aprtable.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_map_aprtable.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_map_aprtable.c 14 May 2002 20:44:21 -  1.10
  +++ jk_map_aprtable.c 4 Feb 2003 07:41:41 -   1.11
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
  + *  Copyright (c) 1999-2003 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  
  
  
  1.28  +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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- jk_logger_apache2.c   8 Jul 2002 12:13:51 -   1.27
  +++ jk_logger_apache2.c   4 Feb 2003 07:41:41 -   1.28
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
  + *  Copyright (c) 1999-2003 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  
  
  
  1.11  +2 -2  

cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c

2002-10-26 Thread mturk
mturk   2002/10/26 05:38:45

  Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
  Log:
  Move the scoreboard and childId detection from service_apache2 to the
  mod_jk2. Also set the child_init hook as last, so that mpm has
  a chance to create the scoreboard.
  
  Revision  ChangesPath
  1.55  +92 -14jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
  
  Index: mod_jk2.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- mod_jk2.c 9 Oct 2002 17:10:52 -   1.54
  +++ mod_jk2.c 26 Oct 2002 12:38:45 -  1.55
   -69,6 +69,7 
   
   #include jk_apache2.h
   #include scoreboard.h
  +#include ap_mpm.h
   
   #include util_script.h
   
   -248,6 +249,8 
   if( child-mbean-debug  -1 ) {
   fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %#lx %s %s 
%s %s\n,
   child, child-uri, parent-uri, child-workerName, 
parent-workerName);
  +fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %#lx %s %s 
%s %s\n,
  +child, child-uri, parent-uri, child-workerName, 
parent-workerName);
   }
   }
   
   -311,7 +314,6 
   env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating workerEnv\n);
   return;
   }
  -
   workerEnv-initData-add( env, workerEnv-initData, serverRoot,
 workerEnv-pool-pstrdup( env, workerEnv-pool, 
ap_server_root));
   env-l-jkLog(env, env-l, JK_LOG_INFO, Set serverRoot %s\n, ap_server_root);
   -329,16 +331,19 
   {
   jk_uriEnv_t *newUri;
   jk_bean_t *jkb;
  -
  +
   if(  workerEnv==NULL ) {
   jk2_create_workerEnv(p, s );
   }
  -if( s-is_virtual == 1 ) {
  +if( s-is_virtual ) {
   /* Virtual host */
  -fprintf( stderr, Create config for virtual host\n);
  +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p,
  +  mod_jk Create config for virtual host %s\n,
  +  s-server_hostname );
   } else {
  -/* Default host */
  -/*  fprintf( stderr, Create config for main host\n); */
  +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p,
  +  mod_jk Create config for default server %s\n,
  +  s-server_hostname );
   }
   
   jkb = workerEnv-globalEnv-createBean2( workerEnv-globalEnv,
   -363,7 +368,9 
   jk_uriEnv_t *base = (jk_uriEnv_t *) basev;
   jk_uriEnv_t *overrides = (jk_uriEnv_t *)overridesv;
   
  -fprintf(stderr,  Merging workerEnv \n );
  +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p,
  +  mod_jk Merging workerEnv\n);
  +
   
   /* The 'mountcopy' option should be implemented in common.
*/
   -375,6 +382,9 
   jk_env_t *env;
   if (workerEnv) {
   env=workerEnv-globalEnv;
  +
  +env-l-jkLog(env, env-l, JK_LOG_INFO,
  +  mod_jk2 Shutting down\n);
   workerEnv-close(env, workerEnv);
   workerEnv = NULL;
   }
   -394,6 +404,10 
   static char * jk2_init(jk_env_t *env, apr_pool_t *pconf,
  jk_workerEnv_t *workerEnv, server_rec *s )
   {
  +/* Ugly hack to get the childId - the index used in the scoreboard,
  +   which we'll use in the jk scoreboard
  +*/
  +
   workerEnv-init(env, workerEnv );
   workerEnv-server_name   = (char *)ap_get_server_version();
   /* Should be done in post config instead (cf DAV2) */
   -459,7 +473,12 
   rc=jk2_apache2_isValidating( plog, gPool );
   
   env-setAprPool(env, gPool);
  -
  +
  +if (!ap_exists_scoreboard_image()) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR, 
  +jk2_postconfig() No scoreboard image %d\n, getpid());
  +}
  +
   if( rc == JK_OK  gPool != NULL ) {
   /* This is the first step */
   env-l-jkLog(env, env-l, JK_LOG_INFO,
   -472,6 +491,7 
   env-l-jkLog(env, env-l, JK_LOG_INFO,
 mod_jk.post_config() second invocation\n ); 
   
  +
   workerEnv-parentInit( env, workerEnv);
   
   
   -488,6 +508,7 
   static void jk2_child_init(apr_pool_t *pconf, 
  server_rec *s)
   {
  +apr_proc_t proc;
   jk_uriEnv_t *serverEnv=(jk_uriEnv_t *)
   ap_get_module_config(s-module_config, jk2_module);
   jk_env_t *env;
   -496,16 +517,71 
   workerEnv = serverEnv-workerEnv;
   
   env=workerEnv-globalEnv;
  +
  +if (!workerEnv-childProcessId)
  +workerEnv-childProcessId = getpid();
  +
  +proc.pid = workerEnv-childProcessId;
   
  -if(!workerEnv-was_initialized) {
  +/* detect if scoreboard exists
  +*/
  +if (!ap_exists_scoreboard_image()) {
  +

cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c

2002-05-16 Thread costin

costin  02/05/16 13:54:18

  Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
  Log:
  We can't call find_by_pid in init() because the scoreboard may not be initialized
  or the process may not be registered.
  
  We can't call it in service() because linux will return the pid of the
  thread, which has nothing to do with the child id ( so it won't be found
  in the scoreboard ).
  
  We need the right pid to find the childId - it used to be available in
  connection_rec. We need the childId because there's no easy way to
  allocate a slot in the jk scoreboard ( or detect a slot is no longer
  used ).
  
  The current workaround is to get the pid in init(), which is called ( hopefully )
  in the child main thread ( which is registered in the scoreboard ).
  And we find the child_num in service, when the scoreboard is supposed
  to be ok.
  
  ( we do the same for apache1.3 - since child_num is only available
  on the first connection )
  
  Revision  ChangesPath
  1.23  +4 -9  jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
  
  Index: mod_jk2.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- mod_jk2.c 15 May 2002 19:46:46 -  1.22
  +++ mod_jk2.c 16 May 2002 20:54:18 -  1.23
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.22 $   *
  + * Version: $Revision: 1.23 $   *
***/
   
   /*
  @@ -78,6 +78,7 @@
   #include http_protocol.h
   #include http_main.h
   #include http_log.h
  +#include scoreboard.h
   
   #include util_script.h
   
  @@ -324,7 +325,7 @@
   fprintf( stderr, Create config for virtual host\n);
   } else {
   /* Default host */
  -fprintf( stderr, Create config for main host\n);
  +/*  fprintf( stderr, Create config for main host\n); */
   }
   
   jkb = workerEnv-globalEnv-createBean2( workerEnv-globalEnv,
  @@ -369,11 +370,6 @@
   static char * jk2_init(jk_env_t *env, apr_pool_t *pconf,
  jk_workerEnv_t *workerEnv, server_rec *s )
   {
  -apr_proc_t proc;
  -
  -proc.pid=getpid();
  -workerEnv-childId=find_child_by_pid(  proc );
  -
   workerEnv-init(env, workerEnv );
   workerEnv-server_name   = (char *)ap_get_server_version();
   ap_add_version_component(pconf, JK_EXPOSED_VERSION);
  @@ -450,6 +446,7 @@
   
   workerEnv-parentInit( env, workerEnv);
   
  +
   /* if(!workerEnv-was_initialized) { */
   /* workerEnv-was_initialized = JK_OK; */
   
  @@ -492,13 +489,11 @@
*/
   static int jk2_handler(request_rec *r)
   {   
  -const char   *worker_name;
   jk_logger_t  *l=NULL;
   int  rc;
   jk_worker_t *worker=NULL;
   jk_endpoint_t *end = NULL;
   jk_uriEnv_t *uriEnv;
  -jk_uriEnv_t *dirEnv;
   jk_env_t *env;
   jk_workerEnv_t *workerEnv;
   
  
  
  
  1.21  +30 -1 
jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c
  
  Index: jk_service_apache2.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- jk_service_apache2.c  15 May 2002 19:46:46 -  1.20
  +++ jk_service_apache2.c  16 May 2002 20:54:18 -  1.21
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat 
* Author:  Gal Shachor [EMAIL PROTECTED]   
* Henri Gomez [EMAIL PROTECTED]
  - * Version: $Revision: 1.20 $   
  + * Version: $Revision: 1.21 $   
*/
   
   #include apu_compat.h
  @@ -354,7 +354,36 @@
   /* Common initialization */
   /* XXX Probably not needed, we're duplicating */
   jk2_requtil_initRequest(env, s);
  +
  +/* Ugly hack to get the childId - the index used in the scoreboard,
  +   which we'll use in the jk scoreboard
  +*/
  +if( workerEnv-childId == -1 ) 
  +{
  +apr_proc_t proc;
   
  +proc.pid=workerEnv-childProcessId;
  +
  +/* detect if scoreboard exists, the method will SIGFLT
  +   since it doesn't check internally
  +