costin      01/11/19 10:14:38

  Modified:    jk/native/common jk_registry.c jk_env.c jk_channel_socket.c
  Log:
  Patch from  Michael Smith.
  
  One change I didn't apply is the signature change in jk_env_objectFactory_t.
  The problem with the worker_factory is that it is specific to workers,
  while objectFactory can create any kind of jk object.
  
  In time we should replace worker_factory and use the new method. ( I'll start
  this soon, I'm working on a proposal )
  
  Revision  Changes    Path
  1.6       +6 -10     jakarta-tomcat-connectors/jk/native/common/jk_registry.c
  
  Index: jk_registry.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_registry.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_registry.c     2001/11/16 22:59:06     1.5
  +++ jk_registry.c     2001/11/19 18:14:38     1.6
  @@ -62,7 +62,7 @@
   
   /***************************************************************************
    * Description: Worker list                                                *
  - * Version:     $Revision: 1.5 $                                           *
  + * Version:     $Revision: 1.6 $                                           *
    ***************************************************************************/
   
   /** Static declarations for all 'hardcoded' modules. This is a hack, 
  @@ -123,19 +123,15 @@
       printf("jk_registry_init: Assertion failed, env==NULL\n" );
       return;
     }
  -  env->registerFactory( env, "worker", "ajp13", (void *)&ajp13_worker_factory );
  -  env->registerFactory( env, "worker", "ajp14", (void *)&ajp14_worker_factory );
  -  env->registerFactory( env, "worker", "lb",    (void *)&lb_worker_factory );
  +  env->registerFactory( env, "worker", "ajp13", &ajp13_worker_factory );
  +  env->registerFactory( env, "worker", "ajp14", &ajp14_worker_factory );
  +  env->registerFactory( env, "worker", "lb",    &lb_worker_factory );
   #ifdef HAVE_JNI
  -  env->registerFactory( env, "worker", "jni",   (void *)&jni_worker_factory );
  +  env->registerFactory( env, "worker", "jni",   &jni_worker_factory );
   #endif
   
  -  env->registerFactory( env, "channel", "socket",   
  -                     (void *)&jk_channel_socket_factory );
  +  env->registerFactory( env, "channel", "socket", &jk_channel_socket_factory );
   
  -  /*
  -  env->registerFactory( env, "channel", "socket",   &jk_channel_socket_factory );
  -  */
     /* Add all other factories here */
   }
   
  
  
  
  1.4       +16 -16    jakarta-tomcat-connectors/jk/native/common/jk_env.c
  
  Index: jk_env.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_env.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_env.c  2001/11/11 01:17:43     1.3
  +++ jk_env.c  2001/11/19 18:14:38     1.4
  @@ -63,13 +63,13 @@
   /* Private methods 
   */
   static jk_env_initEnv( jk_env_t *env, char *id );
  -static jk_env_objectFactory_t *jk_env_getFactory(jk_env_t *env, 
  -                                              char *type,
  -                                              char *name );
  -static void jk_env_registerFactory(jk_env_t *env, 
  -                                char *type,
  -                                char *name, 
  -                                jk_env_objectFactory_t fact);
  +static jk_env_objectFactory_t * JK_METHOD jk_env_getFactory(jk_env_t *env, 
  +                                                            char *type,
  +                                                            char *name );
  +static void JK_METHOD jk_env_registerFactory(jk_env_t *env, 
  +                                             char *type,
  +                                             char *name, 
  +                                             jk_env_objectFactory_t fact);
   
   /* XXX We should have one env per thread to avoid sync problems. 
      The env will provide access to pools, etc 
  @@ -88,16 +88,16 @@
   static jk_env_initEnv( jk_env_t *env, char *id ) {
     /*   env->logger=NULL; */
     /*   map_alloc( & env->properties ); */
  -  env->getFactory= (void *)jk_env_getFactory; 
  -  env->registerFactory= (void *)jk_env_registerFactory; 
  +  env->getFactory= jk_env_getFactory; 
  +  env->registerFactory= jk_env_registerFactory; 
     map_alloc( & env->_registry);
     jk_registry_init(env);
   
   }
   
  -static jk_env_objectFactory_t *jk_env_getFactory(jk_env_t *env, 
  -                                              char *type,
  -                                              char *name )
  +static jk_env_objectFactory_t * JK_METHOD jk_env_getFactory(jk_env_t *env, 
  +                                                            char *type,
  +                                                            char *name )
   {
     jk_env_objectFactory_t *result;
   
  @@ -111,10 +111,10 @@
     return result;
   }
   
  -static void jk_env_registerFactory(jk_env_t *env, 
  -                               char *type,
  -                               char *name, 
  -                               jk_env_objectFactory_t fact)
  +static void JK_METHOD jk_env_registerFactory(jk_env_t *env, 
  +                                             char *type,
  +                                             char *name, 
  +                                             jk_env_objectFactory_t fact)
   {
     void *old;
     
  
  
  
  1.3       +26 -20    jakarta-tomcat-connectors/jk/native/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_channel_socket.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_channel_socket.c       2001/11/16 22:48:55     1.2
  +++ jk_channel_socket.c       2001/11/19 18:14:38     1.3
  @@ -73,6 +73,7 @@
   #include "jk_env.h"
   #include "jk_channel.h"
   #include "jk_global.h"
  +#include "jk_util.h"
   
   #include <string.h>
   
  @@ -107,17 +108,17 @@
   
   int JK_METHOD jk_channel_socket_factory(jk_env_t *env, void **result,
                                        char *type, char *name);
  -static int jk_channel_socket_resolve(char *host, short port,
  +static int JK_METHOD jk_channel_socket_resolve(char *host, short port,
                                     struct sockaddr_in *rc);
   
  -static int jk_channel_socket_getProperty(jk_channel_t *_this, 
  +static int JK_METHOD jk_channel_socket_getProperty(jk_channel_t *_this, 
                                         char *name, char **value)
   {
       return JK_FALSE;
   }
   
  -static int jk_channel_socket_setProperty(jk_channel_t *_this, 
  -                                      char *name, char *value)
  +static int JK_METHOD jk_channel_socket_setProperty(jk_channel_t *_this, 
  +                                                   char *name, char *value)
   {
       jk_channel_socket_private_t *socketInfo=
        (jk_channel_socket_private_t *)(_this->_privatePtr);
  @@ -134,11 +135,11 @@
   
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
    */
  -static int jk_channel_socket_init(jk_channel_t *_this, 
  -                               jk_map_t *props,
  -                               char *worker_name, 
  -                               jk_worker_t *worker, 
  -                               jk_logger_t *l )
  +static int JK_METHOD jk_channel_socket_init(jk_channel_t *_this, 
  +                                            jk_map_t *props,
  +                                            char *worker_name, 
  +                                            jk_worker_t *worker, 
  +                                            jk_logger_t *l )
   {
       int err=jk_log(l, JK_LOG_DEBUG, "Into jk_channel_socket_init\n");
       jk_channel_socket_private_t *socketInfo=
  @@ -168,8 +169,8 @@
   
   /** private: resolve the address on init
    */
  -static int jk_channel_socket_resolve(char *host, short port,
  -                                  struct sockaddr_in *rc)
  +static int JK_METHOD jk_channel_socket_resolve(char *host, short port,
  +                                               struct sockaddr_in *rc)
   {
       int x;
       u_long laddr;
  @@ -203,7 +204,8 @@
   
   /** connect to Tomcat (jk_open_socket)
    */
  -static int jk_channel_socket_open(jk_channel_t *_this, jk_endpoint_t *endpoint)
  +static int JK_METHOD jk_channel_socket_open(jk_channel_t *_this,
  +                                            jk_endpoint_t *endpoint)
   {
       jk_logger_t *l=_this->logger;
       int err=jk_log(l, JK_LOG_DEBUG, "Into jk_channel_socket_open\n");
  @@ -273,7 +275,8 @@
   
   /** close the socket  ( was: jk_close_socket )
   */
  -int jk_channel_socket_close(jk_channel_t *_this, jk_endpoint_t *endpoint)
  +int JK_METHOD jk_channel_socket_close(jk_channel_t *_this,
  +                                      jk_endpoint_t *endpoint)
   {
       int sd;
       jk_channel_socket_data_t *chD=endpoint->channelData;
  @@ -304,9 +307,10 @@
    *             protocol.
    * @was: jk_tcp_socket_sendfull
    */
  -static int jk_channel_socket_send(jk_channel_t *_this,
  +static int JK_METHOD jk_channel_socket_send(jk_channel_t *_this,
                                  jk_endpoint_t *endpoint,
  -                               char *b, int len) 
  +                               char *b,
  +                                  int len) 
   {
       int sd;
       int  sent=0;
  @@ -340,9 +344,9 @@
    *            >0: length of the received data.
    * Was: tcp_socket_recvfull
    */
  -static int jk_channel_socket_recv( jk_channel_t *_this,
  -                                jk_endpoint_t *endpoint,
  -                                char *b, int len ) 
  +static int JK_METHOD jk_channel_socket_recv( jk_channel_t *_this,
  +                                             jk_endpoint_t *endpoint,
  +                                             char *b, int len ) 
   {
       jk_channel_socket_data_t *chD=endpoint->channelData;
       int sd;
  @@ -380,8 +384,10 @@
   
   
   
  -int JK_METHOD jk_channel_socket_factory(jk_env_t *env, void **result,
  -                                     char *type, char *name)
  +int JK_METHOD jk_channel_socket_factory(jk_env_t *env,
  +                                        void **result,
  +                                     char *type,
  +                                        char *name)
   {
       jk_channel_t *channel;
       
  
  
  

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

Reply via email to