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

2002-02-22 Thread hgomez

hgomez  02/02/22 02:05:26

  Removed: jk/native2/server/apache2 mod_jk.c
  Log:
  Remove mod_jk.c

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




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

2002-02-21 Thread hgomez

hgomez  02/02/21 03:21:45

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Last part of jk2 renaming
  All Jk directive renamed to Jk2 to be able to have installed at the same
  time mod_jk 1.x and mod_jk 2.x
  Corrected also Jk(2)Worker directive, now you could use :
  
  Jk2Worker myajp13 port  8009
  Jk2Worker myajp13 host  localhost
  Jk2Worker myajp13 type  ajp13
  Jk2Worker myajp13 lbfactor  1
  
  instead of
  
  Jk2Setworker.myajp13.port  8009
  Jk2Setworker.myajp13.host  localhost
  Jk2Setworker.myajp13.type  ajp13
  Jk2Setworker.myajp13.lbfactor  1
  
  Revision  ChangesPath
  1.20  +99 -96jakarta-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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_jk.c  6 Feb 2002 19:20:59 -   1.19
  +++ mod_jk.c  21 Feb 2002 11:21:45 -  1.20
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.19 $   *
  + * Version: $Revision: 1.20 $   *
***/
   
   /*
  @@ -95,10 +95,10 @@
   
   #include jk_apache2.h
   
  -#define JK_HANDLER  (jakarta-servlet)
  -#define JK_MAGIC_TYPE   (application/x-jakarta-servlet)
  +#define JK_HANDLER  (jakarta-servlet2)
  +#define JK_MAGIC_TYPE   (application/x-jakarta-servlet2)
   
  -module AP_MODULE_DECLARE_DATA jk_module;
  +module AP_MODULE_DECLARE_DATA jk2_module;
   
   static jk_workerEnv_t *workerEnv;
   
  @@ -133,13 +133,13 @@
*/
   
   /**
  - * In order to define a webapp you must add JkWebapp directive
  + * In order to define a webapp you must add Jk2Webapp directive
* in a Location. 
*
* Example:
*   VirtualHost foo.com
*  Location /examples
  - * JkWebapp worker ajp13
  + * Jk2Webapp worker ajp13
*  /Location
*   /VirtualHost
*
  @@ -148,7 +148,7 @@
* of hosts and thousands of webapplications ), 'natural' to any
* apache user.
*/
  -static const char *jk_setWebapp(cmd_parms *cmd, void *per_dir, 
  +static const char *jk2_setWebapp(cmd_parms *cmd, void *per_dir, 
   const char *name, const char *val)
   {
   jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)per_dir;
  @@ -173,7 +173,7 @@
ap_pstrdup(cmd-pool, val));
   }
   
  -fprintf(stderr, JkWebapp  %s %s dir=%s args=%s\n,
  +fprintf(stderr, Jk2Webapp  %s %s dir=%s args=%s\n,
   uriEnv-webapp-workerName, cmd-path,
   cmd-directive-directive,
   cmd-directive-args);
  @@ -187,12 +187,12 @@
* Example:
*   VirtualHost foo.com
*  Location /examples/servlet
  - * JkServlet name servlet
  + * Jk2Servlet name servlet
*  /Location
*   /VirtualHost
*/
  -static const char *jk_setServlet(cmd_parms *cmd, void *per_dir, 
  -const char *name, const char *val)
  +static const char *jk2_setServlet(cmd_parms *cmd, void *per_dir, 
  + const char *name, const char *val)
   {
   jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)per_dir;
   
  @@ -216,14 +216,14 @@
   /** 
* Set jk options.
*
  - * JkFoo value is equivalent with a foo=value setting in
  + * Jk2Foo value is equivalent with a foo=value setting in
* workers.properties. ( XXX rename workers.properties to jk.properties)
*
* We are using a small trick to avoid duplicating the code ( the 'dummy'
* parm ). The values are validated and initalized in jk_init.
*/
  -static const char *jk_set1(cmd_parms *cmd, void *per_dir,
  -   const char *value)
  +static const char *jk2_set1(cmd_parms *cmd, void *per_dir,
  +const char *value)
   {
   server_rec *s = cmd-server;
   struct stat statbuf;
  @@ -232,14 +232,14 @@
   jk_env_t *env;
   
   jk_uriEnv_t *serverEnv=(jk_uriEnv_t *)
  -ap_get_module_config(s-module_config, jk_module);
  +ap_get_module_config(s-module_config, jk2_module);
   jk_workerEnv_t *workerEnv = serverEnv-workerEnv;
   
   jk_map_t *m=workerEnv-init_data;
   
   env=workerEnv-globalEnv;
   
  -value = jk_map_replaceProperties(env, m, m-pool, value);
  +value = jk2_map_replaceProperties(env, m, m-pool, value);
   
   if( cmd-info != NULL ) {
   /* Multi-option config. */
  

RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk.c

2002-02-21 Thread GOMEZ Henri

There is still a problem with Jk2Worker directive (arg)
I'm working on it

-
Henri Gomez ___[_]
EMAIL : [EMAIL PROTECTED](. .) 
PGP KEY : 697ECEDD...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 12:22 PM
To: [EMAIL PROTECTED]
Subject: cvs commit: 
jakarta-tomcat-connectors/jk/native2/server/apache2
mod_jk.c


hgomez  02/02/21 03:21:45

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Last part of jk2 renaming
  All Jk directive renamed to Jk2 to be able to have installed 
at the same
  time mod_jk 1.x and mod_jk 2.x
  Corrected also Jk(2)Worker directive, now you could use :
  
  Jk2Worker myajp13 port  8009
  Jk2Worker myajp13 host  localhost
  Jk2Worker myajp13 type  ajp13
  Jk2Worker myajp13 lbfactor  1
  
  instead of
  
  Jk2Setworker.myajp13.port  8009
  Jk2Setworker.myajp13.host  localhost
  Jk2Setworker.myajp13.type  ajp13
  Jk2Setworker.myajp13.lbfactor  1
  
  Revision  ChangesPath
  1.20  +99 -96
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/m
od_jk.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_jk.c 6 Feb 2002 19:20:59 -   1.19
  +++ mod_jk.c 21 Feb 2002 11:21:45 -  1.20
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat  
   *
* Author:  Gal Shachor [EMAIL PROTECTED]
   *
* Henri Gomez [EMAIL PROTECTED] 
  *
  - * Version: $Revision: 1.19 $   
*
  + * Version: $Revision: 1.20 $   
*

***
/
   
   /*
  @@ -95,10 +95,10 @@
   
   #include jk_apache2.h
   
  -#define JK_HANDLER  (jakarta-servlet)
  -#define JK_MAGIC_TYPE   (application/x-jakarta-servlet)
  +#define JK_HANDLER  (jakarta-servlet2)
  +#define JK_MAGIC_TYPE   (application/x-jakarta-servlet2)
   
  -module AP_MODULE_DECLARE_DATA jk_module;
  +module AP_MODULE_DECLARE_DATA jk2_module;
   
   static jk_workerEnv_t *workerEnv;
   
  @@ -133,13 +133,13 @@
*/
   
   /**
  - * In order to define a webapp you must add JkWebapp directive
  + * In order to define a webapp you must add Jk2Webapp directive
* in a Location. 
*
* Example:
*   VirtualHost foo.com
*  Location /examples
  - * JkWebapp worker ajp13
  + * Jk2Webapp worker ajp13
*  /Location
*   /VirtualHost
*
  @@ -148,7 +148,7 @@
* of hosts and thousands of webapplications ), 'natural' to any
* apache user.
*/
  -static const char *jk_setWebapp(cmd_parms *cmd, void *per_dir, 
  +static const char *jk2_setWebapp(cmd_parms *cmd, void *per_dir, 
   const char *name, const char *val)
   {
   jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)per_dir;
  @@ -173,7 +173,7 @@

ap_pstrdup(cmd-pool, val));
   }
   
  -fprintf(stderr, JkWebapp  %s %s dir=%s args=%s\n,
  +fprintf(stderr, Jk2Webapp  %s %s dir=%s args=%s\n,
   uriEnv-webapp-workerName, cmd-path,
   cmd-directive-directive,
   cmd-directive-args);
  @@ -187,12 +187,12 @@
* Example:
*   VirtualHost foo.com
*  Location /examples/servlet
  - * JkServlet name servlet
  + * Jk2Servlet name servlet
*  /Location
*   /VirtualHost
*/
  -static const char *jk_setServlet(cmd_parms *cmd, void *per_dir, 
  -const char *name, const char *val)
  +static const char *jk2_setServlet(cmd_parms *cmd, void *per_dir, 
  + const char *name, const char *val)
   {
   jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)per_dir;
   
  @@ -216,14 +216,14 @@
   /** 
* Set jk options.
*
  - * JkFoo value is equivalent with a foo=value setting in
  + * Jk2Foo value is equivalent with a foo=value setting in
* workers.properties. ( XXX rename workers.properties to 
jk.properties)
*
* We are using a small trick to avoid duplicating the code 
( the 'dummy'
* parm ). The values are validated and initalized in jk_init.
*/
  -static const char *jk_set1(cmd_parms *cmd, void *per_dir,
  -   const char *value)
  +static const char *jk2_set1(cmd_parms *cmd, void *per_dir,
  +const char *value)
   {
   server_rec *s = cmd-server;
   struct stat statbuf;
  @@ -232,14 +232,14 @@
   jk_env_t *env

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

2002-02-21 Thread hgomez

hgomez  02/02/21 10:13:18

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Jk2Worker works now as needed, note it just use Jk2_set2
  
  Revision  ChangesPath
  1.21  +15 -3 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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- mod_jk.c  21 Feb 2002 11:21:45 -  1.20
  +++ mod_jk.c  21 Feb 2002 18:13:17 -  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 $   *
***/
   
   /*
  @@ -284,6 +284,8 @@
   
   env=workerEnv-globalEnv;
   
  +fprintf( stderr, jk2_set2 : name=%s value=%s\n, name, value);
  +
   value = jk2_map_replaceProperties(env, m, m-pool, value);
   
   if(value==NULL)
  @@ -324,6 +326,15 @@
   static const char *jk2_setWorker(cmd_parms *cmd,void *per_dir,
   const char *wname, const char *wparam, const char 
*value)
   {
  +#ifndef OLD_WAY
  +
  +char * name;
  +name = ap_pstrcat(cmd-pool, worker., wname, ., wparam, NULL);
  +/*  fprintf( stderr, jk2_setWorker : name=%s value=%s\n, name, value); */
  +return (jk2_set2(cmd, per_dir, name, value));
  +
  +#else
  +
   server_rec *s = cmd-server;
   struct stat statbuf;
   char *oldv;
  @@ -339,9 +350,8 @@
   jk_map_t *m=workerEnv-init_data;
   
   env=workerEnv-globalEnv;
  -
  -nvalue = ap_pstrcat(cmd-pool, worker., wname, wparam);
  -/*  fprintf( stderr, wname=%s wparam=%s value=%s\n, wname, wparam, value); */
  +nvalue = ap_pstrcat(cmd-pool, worker., wname, ., wparam, NULL); */
  +/*  fprintf( stderr, wname=%s wparam=%s value=%s zvalue=%s nvalue=%s\n, wname, 
wparam, value, zvalue, nvalue); */
   value = jk2_map_replaceProperties(env, m, m-pool, nvalue);
   
   if(value==NULL)
  @@ -351,6 +361,8 @@
   /* ap_pstrdup(cmd-pool,name), */
   /* ap_pstrdup(cmd-pool,value)); */
   return NULL;
  +
  +#endif
   }
   
   /* Command table.
  
  
  

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




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

2002-02-06 Thread costin

costin  02/02/06 11:20:59

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Updates.
  
  Revision  ChangesPath
  1.19  +11 -12jakarta-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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_jk.c  26 Jan 2002 07:13:47 -  1.18
  +++ mod_jk.c  6 Feb 2002 19:20:59 -   1.19
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.18 $   *
  + * Version: $Revision: 1.19 $   *
***/
   
   /*
  @@ -158,9 +158,9 @@
   uriEnv-webapp=workerEnv-createWebapp( workerEnv-globalEnv, workerEnv,
   NULL, cmd-path, NULL );
   
  -fprintf(stderr, New webapp %p %p\n,uriEnv, uriEnv-webapp);
  +/* fprintf(stderr, New webapp %p %p\n,uriEnv, uriEnv-webapp); */
   } else {
  -fprintf(stderr, Existing webapp %p\n,uriEnv-webapp);
  +/* fprintf(stderr, Existing webapp %p\n,uriEnv-webapp); */
   }
   
   if( strcmp( name, worker) == 0 ) {
  @@ -173,8 +173,8 @@
ap_pstrdup(cmd-pool, val));
   }
   
  -fprintf(stderr, XXX Set worker %p %s %s dir=%s args=%s\n,
  -uriEnv, uriEnv-webapp-workerName, cmd-path,
  +fprintf(stderr, JkWebapp  %s %s dir=%s args=%s\n,
  +uriEnv-webapp-workerName, cmd-path,
   cmd-directive-directive,
   cmd-directive-args);
   
  @@ -205,7 +205,7 @@
ap_pstrdup(cmd-pool, val));
   }
   
  -fprintf(stderr, XXX SetServlet %p %p %s %s dir=%s args=%s\n,
  +fprintf(stderr, JkServlet %p %p %s %s dir=%s args=%s\n,
   uriEnv, uriEnv-webapp, name, val,
   cmd-directive-directive,
   cmd-directive-args);
  @@ -293,7 +293,7 @@
   /* Generic JkSet foo bar */
   m-add(env, m, ap_pstrdup( cmd-pool, name),
  ap_pstrdup( cmd-pool, value));
  -fprintf( stderr, set2.init_data: %s %s\n, name, value );
  +/* fprintf( stderr, set2.init_data: %s %s\n, name, value ); */
   } else if( strcmp(type, env)==0) {
   workerEnv-envvars_in_use = JK_TRUE;
   workerEnv-envvars-put(env, workerEnv-envvars,
  @@ -447,10 +447,10 @@
   
   
   /* XXX */
  -fprintf(stderr, XXX Merged dir config %p %p %s %s %p %p\n,
  -base, new,
  -base-uri, add-uri,
  -base-webapp, add-webapp);
  +/* fprintf(stderr, XXX Merged dir config %p %p %s %s %p %p\n, */
  +/* base, new, */
  +/* base-uri, add-uri, */
  +/* base-webapp, add-webapp); */
   
   if( add-webapp == NULL ) {
   add-webapp=base-webapp;
  @@ -501,7 +501,6 @@
   
   /* Local initialization */
   workerEnv-_private = s;
  -fprintf( stderr, Create worker env %p\n, workerEnv );
   }
   
   /** Create default jk_config. XXX This is mostly server-independent,
  
  
  

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




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

2002-01-15 Thread jfclere

jfclere 02/01/15 05:49:11

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Correct a typo (if the worker is null mod_jk cores).
  
  Revision  ChangesPath
  1.17  +2 -2  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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_jk.c  31 Dec 2001 20:03:15 -  1.16
  +++ mod_jk.c  15 Jan 2002 13:49:11 -  1.17
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.16 $   *
  + * Version: $Revision: 1.17 $   *
***/
   
   /*
  @@ -822,7 +822,7 @@
   
   env-l-jkLog(env, env-l, JK_LOG_INFO, 
 mod_jk.translate(): uriMap %s %s\n,
  -  r-uri, uriEnv-webapp-worker-name);
  +  r-uri, uriEnv-webapp-workerName);
   
   return OK;
   }
  
  
  

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




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

2001-12-31 Thread costin

costin  01/12/31 12:03:15

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Some more changes in mod_jk configuration, to provide a more 'natural'
  style for apache users.
  
  As previously, worker.properties is no longer needed ( but can be used ),
  all settings can be done in httpd.conf ( or generated include file )
  using JkSet name value
  
  Adding 'mounts' is done using Locations - and the mapping is done
  by mod_core only once. I changed the command ( it was added few weeks
  ago ) to JkWebapp worker ajp13 ( other options besides 'worker' will
  be available ).
  
  The JkWebapp should be specified for Locations coresponding the
  the root of the webapp. Autoconf will get the other mappings, or
  generated config.
  
  I added a different JkServlet command to be used for all servlet
  mappings inside a webapp, it'll eventually allow jk to do the
  corect mapping and pass the processed info to tomcat, to avoid duplicating
  it.
  
  Still to do - remove the need to declare WEB-INF/META-INF constraints
  ( we can code this instead of requiring the user to do it ).
  
  ( old config should still work )
  
  Revision  ChangesPath
  1.16  +287 -591  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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- mod_jk.c  18 Dec 2001 22:51:55 -  1.15
  +++ mod_jk.c  31 Dec 2001 20:03:15 -  1.16
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.15 $   *
  + * Version: $Revision: 1.16 $   *
***/
   
   /*
  @@ -100,157 +100,185 @@
   
   module AP_MODULE_DECLARE_DATA jk_module;
   
  -/*  Options setters  */
  +static jk_workerEnv_t *workerEnv;
   
  -/*
  - * The JK module command processors
  - *
  - * The below are all installed so that Apache calls them while it is
  - * processing its config files.  This allows configuration info to be
  - * copied into a jk_server_conf_t object, which is then used for request
  - * filtering/processing.
  - *
  - * See jk_cmds definition below for explanations of these options.
  - */
   
  +/*  Options setters  */
   
   /*
  - * JkMountCopy directive handling
  + * The JK2 module command processors. The options can be specified
  + * in a properties file or in httpd.conf, depending on user's taste.
*
  - * JkMountCopy On/Off
  + * There is absolutely no difference from the point of view of jk,
  + * but apache config tools might prefer httpd.conf and the extra
  + * information included in the command descriptor. It also have
  + * a 'natural' feel, and is consistent with all other apache
  + * settings and modules. 
  + *
  + * Properties file are easier to parse/generate from java, and
  + * allow identical configuration for all servers. We should have
  + * code to generate the properties file or use the wire protocol,
  + * and make all those properties part of server.xml or jk's
  + * java-side configuration. This will give a 'natural' feel for
  + * those comfortable with the java side.
  + *
  + * The only exception is webapp definition, where in the near
  + * future you can expect a scalability difference between the
  + * 2 choices. If you have a large number of apps/vhosts you
  + * _should_ use the apache style, that makes use of the
  + * internal apache mapper ( known to scale to very large number
  + * of hosts ). The internal jk mapper uses linear search, ( will
  + * eventually use hash tables, when we add support for apr_hash ),
  + * and is nowhere near the apache mapper.
  + */
  +
  +/**
  + * In order to define a webapp you must add JkWebapp directive
  + * in a Location. 
  + *
  + * Example:
  + *   VirtualHost foo.com
  + *  Location /examples
  + * JkWebapp worker ajp13
  + *  /Location
  + *   /VirtualHost
  + *
  + * This is the best way to define a webapplication in apache. It is
  + * scalable ( using apache native optimizations, you can have hundreds
  + * of hosts and thousands of webapplications ), 'natural' to any
  + * apache user.
*/
  -static const char *jk_set_mountcopy(cmd_parms *cmd, 
  -void *dummy, 
  -int flag) 
  +static const char *jk_setWebapp(cmd_parms *cmd, void *per_dir, 
  +const char *name, const char *val)
   {
  -

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

2001-12-18 Thread costin

costin  01/12/18 14:51:55

  Modified:jk/native2/common jk_ajp14_worker.c
   jk/native2/include jk_webapp.h
   jk/native2/jni jk_jni_aprImpl.c
   jk/native2/server/apache2 mod_jk.c
  Log:
  Move the reading of initial post data after the sending the request
  ( to do it in paralel )
  
  Few cleanups ( vars not used )
  
  Removed the 'ctl' handler in mod_jk ( that I added few days back for monitoring
  that state). There is a much better and cleaner way to do it.
  
  Started to add some (prototype for now) code to aprImpl ( the Jni side ). We want to
  be able use use unix sockets and few other things from APR from java ( probably
  signals and chuid will also help ). Of course, long-term we should try to create
  a nicer interface, etc - this is now highly experimental.
  
  Revision  ChangesPath
  1.12  +21 -20jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c
  
  Index: jk_ajp14_worker.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_ajp14_worker.c 2001/12/17 07:17:08 1.11
  +++ jk_ajp14_worker.c 2001/12/18 22:51:55 1.12
  @@ -313,25 +313,6 @@
return JK_FALSE;
   }
   
  -/* Prepare to send some post data ( ajp13 proto ) */
  -if (s-is_chunked || s-left_bytes_to_send  0) {
  -/* We never sent any POST data and we check it we have to send at
  -  * least of block of data (max 8k). These data will be kept in reply
  -  * for resend if the remote Tomcat is down, a fact we will learn only
  -  * doing a read (not yet) 
  -  */
  -err=jk_serialize_postHead( env, e-post, s, e );
  -
  -if (err != JK_TRUE ) {
  -/* the browser stop sending data, no need to recover */
  -e-recoverable = JK_FALSE;
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp14.service() Error receiving initial post data\n);
  -return JK_FALSE;
  -}
  -hasPost=JK_TRUE;
  -}
  -
   env-l-jkLog(env, env-l, JK_LOG_INFO,
 ajp14.service() %s\n, e-worker-name);
   
  @@ -386,8 +367,28 @@
   *is_recoverable_error = JK_TRUE;
   e-recoverable = JK_TRUE;
   
  -if( hasPost==JK_TRUE)
  +/* Prepare to send some post data ( ajp13 proto ). We do that after the
  + request was sent ( we're receiving data from client, can be slow, no
  + need to delay - we can do that in paralel. ( not very sure this is
  + very usefull, and it brakes the protocol ) ! */
  +if (s-is_chunked || s-left_bytes_to_send  0) {
  +/* We never sent any POST data and we check it we have to send at
  +  * least of block of data (max 8k). These data will be kept in reply
  +  * for resend if the remote Tomcat is down, a fact we will learn only
  +  * doing a read (not yet) 
  +  */
  +err=jk_serialize_postHead( env, e-post, s, e );
  +
  +if (err != JK_TRUE ) {
  +/* the browser stop sending data, no need to recover */
  +e-recoverable = JK_FALSE;
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp14.service() Error receiving initial post data\n);
  +return JK_FALSE;
  +}
  +
   err= e-post-send( env, e-post, e );
  +}
   
   err = e-worker-workerEnv-processCallbacks(env, e-worker-workerEnv,
e, s);
  
  
  
  1.4   +1 -12 jakarta-tomcat-connectors/jk/native2/include/jk_webapp.h
  
  Index: jk_webapp.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_webapp.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_webapp.h   2001/12/16 23:17:23 1.3
  +++ jk_webapp.h   2001/12/18 22:51:55 1.4
  @@ -140,22 +140,11 @@
   
   /** You can fine-tune the logging level per location
*/
  -int log_level;
  +int logLevel;
   
   /** Different apps can have different loggers.
*/
   struct jk_logger *l;
  -
  -/* SSL Support - you can fine tune this per application.
  - * ( most likely you only do it per virtual host or globally )
  - * XXX shouldn't SSL be enabled by default ???
  - */
  -int  ssl_enable;
  -char *https_indicator;
  -char *certs_indicator;
  -char *cipher_indicator;
  -char *session_indicator;
  -char *key_size_indicator;
   
   /* Jk Options. Bitflag. 
*/
  
  
  
  1.2   +97 -3 jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c
  
  Index: jk_jni_aprImpl.c
  ===
  RCS file: 

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

2001-12-16 Thread costin

costin  01/12/16 15:37:13

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Update to the new methods signatures.
  
  Revision  ChangesPath
  1.13  +136 -104  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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- mod_jk.c  2001/12/15 17:36:25 1.12
  +++ mod_jk.c  2001/12/16 23:37:13 1.13
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.12 $   *
  + * Version: $Revision: 1.13 $   *
***/
   
   /*
  @@ -172,7 +172,8 @@
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
   
   /* Do we know the url ? */
  -webapp=workerEnv-createWebapp( workerEnv, NULL, NULL, NULL );
  +webapp=workerEnv-createWebapp( workerEnv-globalEnv, workerEnv,
  +NULL, NULL, NULL );
   uriEnv-webapp=webapp;
   webapp-workerName=ap_pstrdup(cmd-pool, workerName);
   
  @@ -194,15 +195,16 @@
   {
   server_rec *s = cmd-server;
   struct stat statbuf;
  -jk_logger_t *l;
  +jk_env_t *env;
   
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
  -l=workerEnv-l;
   
   /* we need an absolut path (ap_server_root_relative does the ap_pstrdup) */
   workerEnv-worker_file = ap_server_root_relative(cmd-pool,worker_file);
   
  +env=workerEnv-globalEnv;
  +
   if (workerEnv-worker_file == NULL)
   return JkWorkersFile file_name invalid;
   
  @@ -211,21 +213,21 @@
   
   /** Read worker files
*/
  -l-jkLog(l, JK_LOG_DEBUG, Reading map %s %d\n,
  - workerEnv-worker_file,
  - workerEnv-init_data-size(NULL, workerEnv-init_data) );
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG, Reading map %s %d\n,
  +  workerEnv-worker_file,
  +  workerEnv-init_data-size(env, workerEnv-init_data) );
   
   if( workerEnv-worker_file != NULL ) {
  -int err=jk_map_readFileProperties(NULL, workerEnv-init_data,
  +int err=jk_map_readFileProperties(env, workerEnv-init_data,
 workerEnv-worker_file);
   if( err==JK_TRUE ) {
  -l-jkLog(l, JK_LOG_DEBUG, 
  -   Read map %s %d\n, workerEnv-worker_file,
  - workerEnv-init_data-size( NULL, workerEnv-init_data ) );
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG, 
  +  Read map %s %d\n, workerEnv-worker_file,
  +  workerEnv-init_data-size( env, workerEnv-init_data ) );
   } else {
  -l-jkLog(l, JK_LOG_ERROR, Error reading map %s %d\n,
  -   workerEnv-worker_file,
  - workerEnv-init_data-size( NULL, workerEnv-init_data ) );
  +env-l-jkLog(env, env-l, JK_LOG_ERROR, Error reading map %s %d\n,
  +  workerEnv-worker_file,
  +  workerEnv-init_data-size( env, workerEnv-init_data ) );
   }
   }
   
  @@ -244,24 +246,27 @@
   struct stat statbuf;
   char *oldv;
   int rc;
  +jk_env_t *env;
   
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
   
   jk_map_t *m=workerEnv-init_data;
  +
  +env=workerEnv-globalEnv;
   
  -value = jk_map_replaceProperties(NULL, m, m-pool, value);
  +value = jk_map_replaceProperties(env, m, m-pool, value);
   
  -oldv = jk_map_getString(NULL, m, name, NULL);
  +oldv = jk_map_getString(env, m, name, NULL);
   
   if(oldv) {
  -char *tmpv = apr_palloc(cmd-pool,
  +char *tmpv = apr_palloc( cmd-pool,
   strlen(value) + strlen(oldv) + 3);
   if(tmpv) {
   char sep = '*';
  -if(jk_is_some_property(name, path)) {
  +if(jk_is_some_property(env, name, path)) {
   sep = PATH_SEPERATOR;
  -} else if(jk_is_some_property(name, cmd_line)) {
  +} else if(jk_is_some_property(env, name, cmd_line)) {
   sep = ' ';
   }
   
  @@ -270,13 +275,13 @@
   }
   value = tmpv;
   } else {
  -value = ap_pstrdup(cmd-pool, value);
  +

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

2001-12-15 Thread costin

costin  01/12/15 09:36:25

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Use jk_map for headers.
  
  Make sure we copy all data we'll need later in long-lived pools.
  
  Changed the option ( that I added few weeks ago ) to set jk properties
  in httpd.conf to JkSet. All jk options that can be set in workers.properties
  can also be set using JkSet name value instead of name=value in the
  .properties file.
  
  Finally added the per-dir configuration that will allow the 'native mapper'
  to work. This is still experimental, but will provide huge improvements in
  jk scalability !
  
  The idea is that you can use JkWorker in any Location ( eventually
  included in a VirtualHost section ) to specify that location
  is a webapp and what worker to use. Apache will use it's normal
  mapper to locate the context - without any need to duplicate this in
  jk. For sites with a large number of virtual hosts/apps this is
  very significant.
  
  ( of course, JkMount remains and we'll add the autoconf, but none of
  those should be used for large sites, at least not with the current
  uri mapper )
  
  Revision  ChangesPath
  1.12  +123 -63   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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- mod_jk.c  2001/12/14 07:14:59 1.11
  +++ mod_jk.c  2001/12/15 17:36:25 1.12
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.11 $   *
  + * Version: $Revision: 1.12 $   *
***/
   
   /*
  @@ -151,12 +151,39 @@
   if (context[0]!='/') return Context must start with /;
   
   workerEnv-init_data-put( NULL, workerEnv-init_data,
  -   context, worker, NULL );
  +   ap_pstrdup(cmd-pool,context),
  +   ap_pstrdup(cmd-pool,worker),
  +   NULL );
   
   return NULL;
   }
   
  +/** XXX This should be JkWebapp, it 'defines' the app 
  + */
  +static const char *jk_set_worker(cmd_parms *cmd, void *per_dir, 
  + const char *workerName)
  +{
  +jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)per_dir;
  +jk_webapp_t *webapp;
   
  +server_rec *s = cmd-server;
  +
  +jk_workerEnv_t *workerEnv =
  +(jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
  +
  +/* Do we know the url ? */
  +webapp=workerEnv-createWebapp( workerEnv, NULL, NULL, NULL );
  +uriEnv-webapp=webapp;
  +webapp-workerName=ap_pstrdup(cmd-pool, workerName);
  +
  +uriEnv-workerEnv=workerEnv;
  +
  +fprintf(stderr, XXX Set worker %p %s\n, uriEnv, workerName );
  +
  +return NULL;
  +}
  +
  +
   /*
* JkWorkersFile Directive Handling
*
  @@ -206,7 +233,7 @@
   }
   
   /*
  - * JkWorker name value
  + * JkSet name value
*/
   static const char *jk_worker_property(cmd_parms *cmd,
 void *dummy,
  @@ -247,8 +274,10 @@
   }
   
   if(value) {
  -void *old = NULL;
  -m-put(NULL, m, name, value, old);
  +m-put(NULL, m,
  +   ap_pstrdup(cmd-pool, name),
  +   ap_pstrdup(cmd-pool, value),
  +   NULL);
   /*printf(Setting %s %s\n, name, value);*/
   } 
   return NULL;
  @@ -294,7 +323,8 @@
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
   
  -workerEnv-init_data-put( NULL, workerEnv-init_data, logger.file.level, 
log_level, NULL);
  +workerEnv-init_data-put( NULL, workerEnv-init_data, logger.file.level,
  +   ap_pstrdup(cmd-pool, log_level), NULL);
   return NULL;
   }
   
  @@ -311,7 +341,8 @@
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
   
  -workerEnv-init_data-put( NULL, workerEnv-init_data, 
logger.file.timeFormat, log_format, NULL);
  +workerEnv-init_data-put( NULL, workerEnv-init_data, logger.file.timeFormat,
  +   ap_pstrdup(cmd-pool,log_format), NULL);
   return NULL;
   }
   
  @@ -513,7 +544,8 @@
   
   workerEnv-envvars_in_use = JK_TRUE;
   
  -workerEnv-envvars-put(NULL, workerEnv-envvars, env_name, default_value, 
NULL);
  +workerEnv-envvars-put(NULL, workerEnv-envvars, env_name,
  + 

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

2001-12-12 Thread costin

costin  01/12/12 14:07:25

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  JkMounts will be added to the config, but no actual call is made before init().
  
  ( the same model that is used on the java side in both 3.x and 4.0 - first we
  set properties, then we properly start the object )
  No distinction is made between JkMounts or uriworkers.properties or even
  properties in workers.properties ( or any other properties file ).
  
  During the config stage, we'll collect properties from various sources:
  - workers.properties.
  - native server config ( both specialized JkMount or specific options, or
  JkWorker foo bar which is equivalent with foo=bar in workers.properties ).
  - urimap.properties
  
  That means the config file to be used is entirely matter of taste.
  
  Few more fixes to the code that detects the 'first config' done by
  apache and doesn't initialize on it.
  
  Revision  ChangesPath
  1.9   +32 -55jakarta-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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_jk.c  2001/12/07 23:05:45 1.8
  +++ mod_jk.c  2001/12/12 22:07:25 1.9
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.8 $   *
  + * Version: $Revision: 1.9 $   *
***/
   
   /*
  @@ -69,6 +69,8 @@
   #include ap_config.h
   #include apr_lib.h
   #include apr_date.h
  +#include apr_strings.h
  +
   #include httpd.h
   #include http_config.h
   #include http_request.h
  @@ -76,14 +78,8 @@
   #include http_protocol.h
   #include http_main.h
   #include http_log.h
  -#include util_script.h
   
  -/* moved to apr since http-2.0.19-dev */
  -#if (MODULE_MAGIC_NUMBER_MAJOR  20010523)
  -#include util_date.h
  -#endif
  -
  -#include apr_strings.h
  +#include util_script.h
   /*
* Jakarta (jk_) include files
*/
  @@ -97,9 +93,9 @@
   #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) 
   
   module AP_MODULE_DECLARE_DATA jk_module;
  @@ -332,22 +328,10 @@
   s-remote_host  = NULL_FOR_EMPTY(s-remote_host);
   s-remote_addr  = NULL_FOR_EMPTY(r-connection-remote_ip);
   
  -if( l-level = JK_LOG_DEBUG_LEVEL ) {
  -l-jkLog(l, JK_LOG_DEBUG, 
  -   agsp=%u agsn=%s hostn=%s shostn=%s cbsport=%d sport=%d \n,
  -   ap_get_server_port( r ),
  -   ap_get_server_name( r ),
  -   r-hostname,
  -   r-server-server_hostname,
  -   r-connection-base_server-port,
  -   r-server-port);
  -}
  -
   /* get server name */
   s-server_name= (char *)(r-hostname ? r-hostname :
r-server-server_hostname);
   
  -
   /* get the real port (otherwise redirect failed) */
   apr_sockaddr_port_get(port,r-connection-local_addr);
   s-server_port = port;
  @@ -561,8 +545,7 @@
*
* JkMount URI(context) worker
*/
  -static const char *jk_mount_context(cmd_parms *cmd, 
  -void *dummy, 
  +static const char *jk_mount_context(cmd_parms *cmd, void *dummy, 
   const char *context,
   const char *worker,
   const char *maybe_cookie)
  @@ -570,21 +553,11 @@
   server_rec *s = cmd-server;
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
  -char *old;
  -jk_uriMap_t *uriMap=workerEnv-uriMap;
  -jk_uriEnv_t *uriEnv;
   
  -if (context[0]!='/')
  -return Context should start with /;
  +if (context[0]!='/') return Context must start with /;
   
  -/*
  - * Add the new worker to the alias map. XXX host ?
  - */
  -uriEnv=uriMap-addMapping( uriMap, NULL, context, worker );
  -if( uriEnv==NULL ) {
  -ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 
  - NULL, mod_jk: Error mounting %s %s \n, context, worker  );
  -}
  +map_put( workerEnv-init_data, context, worker, NULL );
  +
   return NULL;
   }
   
  @@ -594,8 +567,7 @@
*
* JkWorkersFile file
*/
  -static const char 

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

2001-12-07 Thread costin

costin  01/12/07 15:05:45

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  - use r-request_config to pass the uriEnv ( the result of mapping ) instead
  of a note. This way we avoid few ( dozens ? ) string cmps, no need to pass the
  workerEnv (we pass the real structure ), the code is much simpler.
  
  - Finally ( ??? ) get rid of the double initialization. Apache unloads all
  modules after it reads the config, so if .so is used our 'is_initialized'
  will disapear as well.
  
  Now we use the 'top' pool ( gpool ), which is unlikely to disapear, and
  we set a userdata attribute. We do the initialization only the second time.
  ( we should validate the data on the first run ).
  
  ( this still needs testing, but it seems it is a good track )
  
  Revision  ChangesPath
  1.8   +90 -124   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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_jk.c  2001/12/06 22:50:25 1.7
  +++ mod_jk.c  2001/12/07 23:05:45 1.8
  @@ -59,7 +59,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.7 $   *
  + * Version: $Revision: 1.8 $   *
***/
   
   /*
  @@ -288,28 +288,6 @@
   /* Utility functions */
   /* = */
   
  -/* = */
  -/* Log something to Jk log file then exit */
  -static void jk_error_exit(const char *file, 
  -  int line, 
  -  int level, 
  -  const server_rec *s, 
  -  apr_pool_t *p, 
  -  const char *fmt, ...)
  -{
  -va_list ap;
  -char *res;
  -
  -va_start(ap, fmt);
  -res = apr_pvsprintf(s-process-pool, fmt, ap);
  -va_end(ap);
  -
  -ap_log_error(file, line, level, 0, s, res);
  -
  -/* Exit process */
  -exit(1);
  -}
  -
   static int get_content_length(request_rec *r)
   {
   if(r-clength  0) {
  @@ -713,7 +691,6 @@
*
* JkLogFile file
*/
  -
   static const char *jk_set_log_file(cmd_parms *cmd, 
  void *dummy, 
  const char *log_file)
  @@ -894,7 +871,6 @@
*  ForwardURICompatUnparsed = Forward URI as unparsed, spec compliant but broke 
mod_rewrite (old TC)
*  ForwardURIEscaped   = Forward URI escaped and Tomcat (3.3 rc2) stuff will 
do the decoding part
*/
  -
   static const char *jk_set_options(cmd_parms *cmd,
 void *dummy,
 const char *line)
  @@ -944,7 +920,8 @@
   else if (action == '+') {
   workerEnv-options |=  opt;
   }
  -else {/* for now +Opt == Opt */
  +else {
  +/* for now +Opt == Opt */
   workerEnv-options |=  opt;
   }
   }
  @@ -956,7 +933,6 @@
*
* JkEnvVar MYOWNDIR
*/
  -
   static const char *jk_add_env_var(cmd_parms *cmd,
 void *dummy,
 const char *env_name,
  @@ -1100,7 +1076,7 @@
   jk_uriEnv_t *new =
   (jk_uriEnv_t *)apr_pcalloc(p, sizeof(jk_uriEnv_t));
   
  -printf(XXX Create dir config \n);
  +printf(XXX Create dir config %s\n, dummy);
   return new;
   }
   
  @@ -1182,7 +1158,7 @@
   /* Local initialization */
   workerEnv-_private = s;
   
  -printf(XXX Create jk config\n);
  +workerEnv-l-jkLog(workerEnv-l, JK_LOG_INFO, mod_jk.create_jk_config()\n ); 
   return workerEnv;
   }
   
  @@ -1230,8 +1206,6 @@
   if(!uri_worker_map_alloc((overrides-uw_map), 
overrides-uri_to_context, 
overrides-log)) {
  -jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides-s, 
  -  overrides-s-process-pool, Memory error);
   }
   
   if (base-secret_key)
  @@ -1249,9 +1223,11 @@
   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? */
  -  }
  +workerEnv-l-jkLog(workerEnv-l, JK_LOG_INFO, mod_jk child init\n );

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

2001-12-04 Thread costin

costin  01/12/04 11:12:52

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Fixes.
  
  It now seems to work ( but keep gdb around :-).
  
  This version is using the apache logger and error.log - it'll be optional,
  but I want it tested a bit.
  
  Revision  ChangesPath
  1.4   +11 -8 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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- mod_jk.c  2001/12/02 02:09:45 1.3
  +++ mod_jk.c  2001/12/04 19:12:52 1.4
  @@ -60,7 +60,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.3 $   *
  + * Version: $Revision: 1.4 $   *
***/
   
   /*
  @@ -89,7 +89,6 @@
* Jakarta (jk_) include files
*/
   #include jk_global.h
  -#include jk_util.h
   #include jk_map.h
   #include jk_pool.h
   #include jk_env.h
  @@ -246,7 +245,7 @@
   
   static int JK_METHOD ws_write(jk_ws_service_t *s,
 const void *b,
  -  unsigned l)
  +  unsigned len)
   {
   jk_logger_t *l=s-workerEnv-l;
   
  @@ -257,7 +256,7 @@
   /* BUFF *bf = p-r-connection-client; */
   size_t w = (size_t)l;
   size_t r = 0;
  -long ll=l;
  +long ll=len;
   char *bb=(char *)b;
   
   if(!p-response_started) {
  @@ -701,9 +700,9 @@
   strlen(value) + strlen(oldv) + 3);
   if(tmpv) {
   char sep = '*';
  -if(jk_is_path_poperty(name)) {
  +if(jk_is_some_property(name, path)) {
   sep = PATH_SEPERATOR;
  -} else if(jk_is_cmd_line_poperty(name)) {
  +} else if(jk_is_some_property(name, cmd_line)) {
   sep = ' ';
   }
   
  @@ -1211,7 +1210,7 @@
   private_data.read_body_started = JK_FALSE;
   private_data.r = r;
   
  -jk_init_ws_service(s);
  +jk_requtil_initRequest(s);
   
   s.ws_private = private_data;
   s.pool = private_data.p;
  @@ -1291,7 +1290,9 @@
   
   env=jk_env_getEnv( NULL );
   
  -l = env-getInstance( env, logger, file);
  +/* l = env-getInstance( env, logger, file); */
  +jk_logger_apache2_factory( env, l, logger, file);
  +l-logger_private=s;
   
   env-logger=l;
   
  @@ -1483,6 +1484,8 @@
   
   r-handler=apr_pstrdup(r-pool,JK_HANDLER);
   apr_table_setn(r-notes, JK_WORKER_ID, uriEnv-worker-name);
  +l-jkLog(l, JK_LOG_DEBUG, 
  +   mod_jk: map %s %s\n, r-uri, uriEnv-worker-name);
   return OK;
   }
   }
  
  
  

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




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

2001-12-04 Thread costin

costin  01/12/04 15:59:01

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Updated. Started to add the per_dir structure that will allow
  JkSetWorker inside Locations. This in turn will allow full 'native'
  configuration for apache ( i.e. using SetHandler and Location instead
  of JkMount ). ( all is optional of course, JkMount and uriWorkerMap remain
  the default ).
  
  In addition per_dir config allows faster access to jk info.
  
  Added comments about using request_config instead of notes to pass worker
  information ( plus per_dir_config ).
  
  jk_translate will detect SetHandler-style configuration and do the shortcut.
  
  Revision  ChangesPath
  1.5   +100 -73   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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_jk.c  2001/12/04 19:12:52 1.4
  +++ mod_jk.c  2001/12/04 23:59:01 1.5
  @@ -60,7 +60,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.4 $   *
  + * Version: $Revision: 1.5 $   *
***/
   
   /*
  @@ -104,16 +104,6 @@
   
   AP_MODULE_DECLARE_DATA module jk_module;
   
  -struct apache_private_data {
  -jk_pool_t p;
  -
  -int response_started;
  -int read_body_started;
  -request_rec *r;
  -};
  -
  -typedef struct apache_private_data apache_private_data_t;
  -
   
   static int JK_METHOD ws_start_response(jk_ws_service_t *s,
  int status,
  @@ -147,8 +137,7 @@
   {
   if(s  s-ws_private) {
   unsigned h;
  -apache_private_data_t *p = s-ws_private;
  -request_rec *r = p-r;
  +request_rec *r = (request_rec *)s-ws_private;  
   
   if(!reason) {
   reason = ;
  @@ -185,8 +174,8 @@
   
   /* this NOP function was removed in apache 2.0 alpha14 */
   /* ap_send_http_header(r); */
  -  p-response_started = JK_TRUE;
  -
  +s-response_started = JK_TRUE;
  +  
   return JK_TRUE;
   }
   return JK_FALSE;
  @@ -207,16 +196,15 @@
unsigned *actually_read)
   {
   if(s  s-ws_private  b  actually_read) {
  -apache_private_data_t *p = s-ws_private;
  -if(!p-read_body_started) {
  -   if(ap_should_client_block(p-r)) {
  -p-read_body_started = JK_TRUE;
  +if(!s-read_body_started) {
  +   if(ap_should_client_block(s-ws_private)) {
  +s-read_body_started = JK_TRUE;
   }
   }
   
  -if(p-read_body_started) {
  +if(s-read_body_started) {
   long rv;
  -if ((rv = ap_get_client_block(p-r, b, len))  0) {
  +if ((rv = ap_get_client_block(s-ws_private, b, len))  0) {
   *actually_read = 0;
   } else {
   *actually_read = (unsigned) rv;
  @@ -250,8 +238,6 @@
   jk_logger_t *l=s-workerEnv-l;
   
   if(s  s-ws_private  b) {
  -apache_private_data_t *p = s-ws_private;
  -
   if(l) {
   /* BUFF *bf = p-r-connection-client; */
   size_t w = (size_t)l;
  @@ -259,7 +245,7 @@
   long ll=len;
   char *bb=(char *)b;
   
  -if(!p-response_started) {
  +if(!s-response_started) {
   l-jkLog(l, JK_LOG_DEBUG, 
  Write without start, starting with defaults\n);
   if(!s-start_response(s, 200, NULL, NULL, NULL, 0)) {
  @@ -270,7 +256,7 @@
   /* Debug - try to get around rwrite */
   while( ll  0 ) {
   unsigned long toSend=(llCHUNK_SIZE) ? CHUNK_SIZE : ll;
  -r = ap_rwrite((const char *)bb, toSend, p-r );
  +r = ap_rwrite((const char *)bb, toSend, s-ws_private );
   l-jkLog(l, JK_LOG_DEBUG, 
  writing %ld (%ld) out of %ld \n,toSend, r, ll );
   ll-=CHUNK_SIZE;
  @@ -285,7 +271,7 @@
   /*
* To allow server push. After writing full buffers
*/
  -if(ap_rflush(p-r) != APR_SUCCESS) {
  +if(ap_rflush(s-ws_private) != APR_SUCCESS) {
   ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 
NULL, mod_jk: Error flushing \n  );
   

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

2001-12-01 Thread costin

costin  01/12/01 14:41:41

  Added:   jk/native2/server/apache2 mod_jk.c
  Log:
  First server adapter to compile with the new classes.
  
  It probably doesn't work, but it's close :-)
  
  For now I'll just play with this one, after the interfaces are stable I'll
  start updating the other 3-4 server adapters.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c
  
  Index: mod_jk.c
  ===
  /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */
  /* = *
   *   *
   * The Apache Software License,  Version 1.1 *
   *   *
   *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
   *   All rights reserved.*
   *   *
   * = *
   *   *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *   *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *notice, this list of conditions and the following disclaimer.  *
   *   *
   * 2. Redistributions  in binary  form  must  reproduce the  above copyright *
   *notice,  this list of conditions  and the following  disclaimer in the *
   *documentation and/or other materials provided with the distribution.   *
   *   *
   * 3. The end-user documentation  included with the redistribution,  if any, *
   *must include the following acknowlegement: *
   *   *
   *   This product includes  software developed  by the Apache  Software *
   *Foundation http://www.apache.org/.  *
   *   *
   *Alternately, this acknowlegement may appear in the software itself, if *
   *and wherever such third-party acknowlegements normally appear. *
   *   *
   * 4. The names  The  Jakarta  Project,  Jk,  and  Apache  Software *
   *Foundation  must not be used  to endorse or promote  products derived *
   *from this  software without  prior  written  permission.  For  written *
   *permission, please contact [EMAIL PROTECTED].*
   *   *
   * 5. Products derived from this software may not be called Apache nor may *
   *Apache appear in their names without prior written permission of the *
   *Apache Software Foundation.*
   *   *
   * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES *
   * INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY *
   * AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL *
   * THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY *
   * DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL *
   * DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS *
   * OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION) *
   * HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT, *
   * STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
   * ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE *
   * POSSIBILITY OF SUCH DAMAGE.   *
   *   *
   * = *
   *   *
   * This software  consists of voluntary  contributions made  by many indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see http://www.apache.org/.   *
   * 

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

2001-12-01 Thread costin

costin  01/12/01 17:06:52

  Modified:jk/native2/server/apache2 mod_jk.c
  Log:
  Update mod_jk.
  
  Apache now starts without any core dump ( :-) ), I haven't tried to use it
  yet, probably tommorow.
  
  Revision  ChangesPath
  1.2   +117 -116  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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_jk.c  2001/12/01 22:41:40 1.1
  +++ mod_jk.c  2001/12/02 01:06:52 1.2
  @@ -60,7 +60,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.1 $   *
  + * Version: $Revision: 1.2 $   *
***/
   
   /*
  @@ -103,7 +103,7 @@
   #define JK_MAGIC_TYPE   (application/x-jakarta-servlet)
   #define NULL_FOR_EMPTY(x)   ((x  !strlen(x)) ? NULL : x) 
   
  -AP_DECLARE_DATA module jk_module;
  +AP_MODULE_DECLARE_DATA module jk_module;
   
   struct apache_private_data {
   jk_pool_t p;
  @@ -248,6 +248,8 @@
 const void *b,
 unsigned l)
   {
  +jk_logger_t *l=s-workerEnv-l;
  +
   if(s  s-ws_private  b) {
   apache_private_data_t *p = s-ws_private;
   
  @@ -259,7 +261,7 @@
   char *bb=(char *)b;
   
   if(!p-response_started) {
  -jk_log(s-workerEnv-l, JK_LOG_DEBUG, 
  +l-jkLog(l, JK_LOG_DEBUG, 
  Write without start, starting with defaults\n);
   if(!s-start_response(s, 200, NULL, NULL, NULL, 0)) {
   return JK_FALSE;
  @@ -270,7 +272,7 @@
   while( ll  0 ) {
   unsigned long toSend=(llCHUNK_SIZE) ? CHUNK_SIZE : ll;
   r = ap_rwrite((const char *)bb, toSend, p-r );
  -jk_log(s-workerEnv-l, JK_LOG_DEBUG, 
  +l-jkLog(l, JK_LOG_DEBUG, 
  writing %ld (%ld) out of %ld \n,toSend, r, ll );
   ll-=CHUNK_SIZE;
   bb+=CHUNK_SIZE;
  @@ -346,6 +348,7 @@
  jk_workerEnv_t *workerEnv)
   {
   request_rec *r  = private_data-r;
  +jk_logger_t *l=s-workerEnv-l;
   
   apr_port_t port;
   
  @@ -367,8 +370,8 @@
   s-remote_host  = NULL_FOR_EMPTY(s-remote_host);
   s-remote_addr  = NULL_FOR_EMPTY(r-connection-remote_ip);
   
  -if( s-workerEnv-l-level = JK_LOG_DEBUG_LEVEL ) {
  -jk_log(s-workerEnv-l, JK_LOG_DEBUG, 
  +if( l-level = JK_LOG_DEBUG_LEVEL ) {
  +l-jkLog(l, JK_LOG_DEBUG, 
  agsp=%u agsn=%s hostn=%s shostn=%s cbsport=%d sport=%d \n,
  ap_get_server_port( r ),
  ap_get_server_name( r ),
  @@ -635,19 +638,39 @@
   {
   server_rec *s = cmd-server;
   struct stat statbuf;
  +jk_logger_t *l;
   
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
  -
  +l=workerEnv-l;
  +
   /* we need an absolut path (ap_server_root_relative does the ap_pstrdup) */
   workerEnv-worker_file = ap_server_root_relative(cmd-pool,worker_file);
  - 
  +
   if (workerEnv-worker_file == NULL)
   return JkWorkersFile file_name invalid;
   
   if (stat(workerEnv-worker_file, statbuf) == -1)
   return Can't find the workers file specified;
   
  +/** Read worker files
  + */
  +l-jkLog(l, JK_LOG_DEBUG, Reading map %s %d\n,
  +   workerEnv-worker_file, map_size( workerEnv-init_data ) );
  +
  +if( workerEnv-worker_file != NULL ) {
  +int err=map_read_properties(workerEnv-init_data,
  +workerEnv-worker_file);
  +if( err==JK_TRUE ) {
  +l-jkLog(l, JK_LOG_DEBUG, 
  +   Read map %s %d\n, workerEnv-worker_file,
  +   map_size( workerEnv-init_data ) );
  +} else {
  +l-jkLog(l, JK_LOG_ERROR, Error reading map %s %d\n,
  +   workerEnv-worker_file, map_size( workerEnv-init_data ) );
  +}
  +}
  +
   return NULL;
   }
   
  @@ -667,7 +690,7 @@
   jk_workerEnv_t *workerEnv =
   (jk_workerEnv_t *)ap_get_module_config(s-module_config, jk_module);
   
  -jk_map_t *m=workerEnv-worker_properties;
  +jk_map_t *m=workerEnv-init_data;
   
   value = map_replace_properties(value, m );
   
  @@ -714,13 +737,16 @@
   server_rec *s = 

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

2001-12-01 Thread costin

costin  01/12/01 18:09:45

  Modified:jk/native2/common jk_logger_file.c jk_uriMap.c
   jk/native2/include jk_logger.h
   jk/native2/server/apache2 mod_jk.c
  Log:
  More fixes, now it seems the startup sequence is ok.
  
  The support for urimappings.properties ( used right now only for IIS )
  is now available to all servers, and can be specified in workers.properties as well.
  
  ( next step is to have an easy way to specify and load multiple files ).
  
  Note that worker.properties settings can be replaced with JkWorker name value in
  httpd.conf ( i.e. you can do all the settings in httpd.conf, no need for a real
  worker.properties if you prefer to use a single file )
  
  Revision  ChangesPath
  1.3   +24 -18jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c
  
  Index: jk_logger_file.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_logger_file.c  2001/12/02 01:01:42 1.2
  +++ jk_logger_file.c  2001/12/02 02:09:44 1.3
  @@ -59,7 +59,7 @@
* Description: Utility functions (mainly configuration)   *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.2 $   *
  + * Version: $Revision: 1.3 $   *
***/
   
   #include jk_util.h
  @@ -103,20 +103,20 @@
 int level,
 const char *what)
   {
  +FILE *f = (FILE *)l-logger_private;
  +
  +if( f==NULL ) {
  +/* This is usefull to debug what happens before logger is set.
  +   On apache you need -X option ( no detach, single process ) */
  +printf(%s, what );
  +return JK_TRUE;
  +}
   if(l  l-level = level  l-logger_private  what) {   
   unsigned sz = strlen(what);
   if(sz) {
  -FILE *f = (FILE *)l-logger_private;
  -
  -if( f==NULL ) {
  -/* This is usefull to debug what happens before logger is set.
  -   On apache you need -X option ( no detach, single process ) */
  -printf(%s, what );
  -} else { 
  -fwrite(what, 1, sz, f);
  -/* [V] Flush the dam' thing! */
  -fflush(f);
  -}
  +fwrite(what, 1, sz, f);
  +/* [V] Flush the dam' thing! */
  +fflush(f);
   }
   
   return JK_TRUE;
  @@ -150,18 +150,24 @@
   char *file=map_getStrProp(properties,logger,file,
 name,mod_jk.log);
   int level;
  -char *levelS=map_getIntProp(properties,logger,file,
  +char *levelS=map_getStrProp(properties,logger,file,
   level, ERROR);
  -char *logformat=map_getIntProp(properties,logger,file,
  +char *logformat=map_getStrProp(properties,logger,file,
  timeFormat, JK_TIME_FORMAT);
   FILE *f;
   
   _this-level = jk_logger_file_parseLogLevel(levelS);
  -
  +if( _this-level == 0 )
  +_this-jkLog( _this, JK_LOG_ERROR, Level %s %d \n, levelS, _this-level 
); */
  +
  +if( logformat==NULL ) {
  +logformat=JK_TIME_FORMAT;
  +}
   jk_logger_file_logFmt = logformat;
   
   f = fopen(file, a+);
  -if(!f) {
  +if(f==NULL) {
  +_this-jkLog(_this,JK_LOG_ERROR,Can't open log file %s\n, file );
   return JK_FALSE;
   }
   _this-logger_private = f;
  @@ -193,7 +199,7 @@
   return -1;
   }
   
  -if(l==NULL ||
  +if(l-logger_private==NULL ||
  l-level = level) {
   #ifdef NETWARE
   /* On NetWare, this can get called on a thread that has a limited stack so */
  @@ -267,7 +273,7 @@
   
   l-log = jk_logger_file_log;
   l-logger_private = NULL;
  -l-open = jk_logger_file_open;
  +l-open =jk_logger_file_open;
   l-jkLog = jk_logger_file_jkLog;
   
   *result=(void *)l;
  
  
  
  1.3   +19 -9 jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c
  
  Index: jk_uriMap.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_uriMap.c   2001/12/02 01:05:25 1.2
  +++ jk_uriMap.c   2001/12/02 02:09:44 1.3
  @@ -67,7 +67,7 @@
* servlet container.  *
*