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/common jk_channel_apr_socket.c jk_channel_jni.c jk_channel_socket.c jk_channel_un.c jk_workerEnv.c
Date Sun, 26 May 2002 07:30:01 GMT
costin      02/05/26 00:30:01

  Modified:    jk/native2/common jk_channel_apr_socket.c jk_channel_jni.c
                        jk_channel_socket.c jk_channel_un.c jk_workerEnv.c
  Log:
  Moved channels to use the init() method in jk_bean.
  
  ( all jk components will eventually be useable from java using
  the ajp 'bridge', but channels are important and need to be initialized
  corectly )
  
  Revision  Changes    Path
  1.20      +3 -2      jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
  
  Index: jk_channel_apr_socket.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_channel_apr_socket.c	16 May 2002 23:48:27 -0000	1.19
  +++ jk_channel_apr_socket.c	26 May 2002 07:30:01 -0000	1.20
  @@ -133,8 +133,9 @@
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
    */
   static int JK_METHOD jk2_channel_apr_init(jk_env_t *env,
  -                                          jk_channel_t *ch)
  +                                          jk_bean_t *chB)
   {
  +    jk_channel_t *ch=chB->object;
       jk_channel_apr_private_t *socketInfo=
           (jk_channel_apr_private_t *)(ch->_privatePtr);
       int rc;
  @@ -431,7 +432,6 @@
   
       ch->recv= jk2_channel_apr_recv; 
       ch->send= jk2_channel_apr_send; 
  -    ch->init= jk2_channel_apr_init; 
       ch->open= jk2_channel_apr_open; 
       ch->close= jk2_channel_apr_close; 
       ch->is_stream=JK_TRUE;
  @@ -439,6 +439,7 @@
       result->setAttribute= jk2_channel_apr_setProperty; 
       ch->mbean=result;
       result->object= ch;
  +    result->init= jk2_channel_apr_init; 
   
       ch->workerEnv=env->getByName( env, "workerEnv" );
       ch->workerEnv->addChannel( env, ch->workerEnv, ch );
  
  
  
  1.22      +8 -10     jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c
  
  Index: jk_channel_jni.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- jk_channel_jni.c	19 May 2002 21:41:25 -0000	1.21
  +++ jk_channel_jni.c	26 May 2002 07:30:01 -0000	1.22
  @@ -106,7 +106,7 @@
   
   
   
  -static int JK_METHOD jk2_channel_jni_setProperty(jk_env_t *env,
  +static int JK_METHOD jk2_channel_jni_setAttribute(jk_env_t *env,
                                                    jk_bean_t *mbean, 
                                                    char *name, void *valueP)
   {
  @@ -120,8 +120,9 @@
   }
   
   static int JK_METHOD jk2_channel_jni_init(jk_env_t *env,
  -                                          jk_channel_t *jniW)
  +                                          jk_bean_t *jniWB)
   {
  +    jk_channel_t *jniW=jniWB->object;
       jk_workerEnv_t *wEnv=jniW->workerEnv;
   
       if( wEnv->vm == NULL ) {
  @@ -156,7 +157,7 @@
           return JK_OK;
       }
       
  -    env->l->jkLog(env, env->l, JK_LOG_INFO,"channel_jni.init():  \n" );
  +    env->l->jkLog(env, env->l, JK_LOG_INFO,"channel_jni.open():  \n" );
   
       if( _this->worker != NULL )
           _this->worker->mbean->disabled=JK_TRUE;
  @@ -313,10 +314,7 @@
       if( epData->jniJavaContext != NULL){
           (*jniEnv)->DeleteGlobalRef( jniEnv, epData->jniJavaContext );
       }
  -    endpoint->mbean->pool->realloc(env,endpoint->mbean->pool,0,
  -        epData->carray,epData->arrayLen);
  -    endpoint->mbean->pool->realloc(env,endpoint->mbean->pool,0,
  -        epData,sizeof( jk_ch_jni_ep_private_t ));
  +    
       endpoint->channelData=NULL;
       return JK_OK;
   
  @@ -404,7 +402,7 @@
       nbuf = (*jniEnv)->GetPrimitiveArrayCritical(jniEnv, jbuf, &iscopy);
   #else
       nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, jbuf, &iscopy);
  -#endif
  + #endif
       if( iscopy )
           env->l->jkLog(env, env->l, JK_LOG_INFO,
                         "channelJni.send() get java bytes iscopy %d\n", iscopy);
  @@ -545,7 +543,6 @@
       
       ch->recv= jk2_channel_jni_recv;
       ch->send= jk2_channel_jni_send; 
  -    ch->init= jk2_channel_jni_init; 
       ch->open= jk2_channel_jni_open; 
       ch->close= jk2_channel_jni_close; 
   
  @@ -556,9 +553,10 @@
                       sizeof(jk_channel_jni_private_t));
       ch->is_stream=JK_FALSE;
   
  -    result->setAttribute= jk2_channel_jni_setProperty;
  +    result->setAttribute= jk2_channel_jni_setAttribute;
       ch->mbean=result;
       result->object= ch;
  +    result->init= jk2_channel_jni_init; 
   
       wEnv=env->getByName( env, "workerEnv" );
       ch->workerEnv=wEnv;
  
  
  
  1.29      +3 -2      jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- jk_channel_socket.c	23 May 2002 14:54:07 -0000	1.28
  +++ jk_channel_socket.c	26 May 2002 07:30:01 -0000	1.29
  @@ -140,8 +140,9 @@
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
    */
   static int JK_METHOD jk2_channel_socket_init(jk_env_t *env,
  -                                             jk_channel_t *ch )
  +                                             jk_bean_t *chB )
   {
  +    jk_channel_t *ch=chB->object;
       jk_channel_socket_private_t *socketInfo=
   	(jk_channel_socket_private_t *)(ch->_privatePtr);
       int rc;
  @@ -580,13 +581,13 @@
   
       ch->recv= jk2_channel_socket_recv; 
       ch->send= jk2_channel_socket_send; 
  -    ch->init= jk2_channel_socket_init; 
       ch->open= jk2_channel_socket_open; 
       ch->close= jk2_channel_socket_close; 
   
       ch->is_stream=JK_TRUE;
   
       result->setAttribute= jk2_channel_socket_setAttribute; 
  +    result->init= jk2_channel_socket_init; 
   
       /*result->getAttributeInfo=jk2_channel_socket_getAttributeInfo;*/
       result->multiValueInfo=jk2_channel_socket_multiValueInfo;
  
  
  
  1.7       +15 -3     jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_channel_un.c	16 May 2002 21:03:44 -0000	1.6
  +++ jk_channel_un.c	26 May 2002 07:30:01 -0000	1.7
  @@ -83,13 +83,18 @@
   
   #ifdef HAVE_UNIXSOCKETS    
   
  -
   /** Information specific for the socket channel
    */
   typedef struct jk_channel_un_private {
       int ndelay;
       struct sockaddr_un unix_addr;
       char *file;
  +
  +    int l_onoff;                /* Nonzero to linger on close.  */
  +    int l_linger;               /* Time to linger.  */
  +
  +    int backlog;
  +    int doListen;
   } jk_channel_un_private_t;
   
   static int JK_METHOD jk2_channel_un_close(jk_env_t *env, jk_channel_t *ch,
  @@ -110,6 +115,11 @@
   
       if( strcmp( "file", name ) == 0 ) {
           socketInfo->file=value;
  +    } else if( strcmp( "soLinger", name ) == 0 ) {
  +        socketInfo->l_linger=atoi( value );
  +    } else if( strcmp( "listen", name ) == 0 ) {
  +        socketInfo->backlog=atoi( value );
  +        socketInfo->doListen=JK_TRUE;
       } else {
   	if( ch->worker!=NULL ) {
               return ch->worker->mbean->setAttribute( env, ch->worker->mbean,
name, valueP );
  @@ -122,8 +132,9 @@
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
    */
   static int JK_METHOD jk2_channel_un_init(jk_env_t *env,
  -                                         jk_channel_t *ch)
  +                                         jk_bean_t *chB)
   {
  +    jk_channel_t *ch=chB->object;
       jk_channel_un_private_t *socketInfo=
           (jk_channel_un_private_t *)(ch->_privatePtr);
       int rc=JK_OK;
  @@ -356,6 +367,7 @@
   
   }
   
  +
   int JK_METHOD jk2_channel_un_factory(jk_env_t *env,
                                        jk_pool_t *pool, 
                                        jk_bean_t *result,
  @@ -370,7 +382,6 @@
   
       ch->recv= jk2_channel_un_recv; 
       ch->send= jk2_channel_un_send; 
  -    ch->init= jk2_channel_un_init; 
       ch->open= jk2_channel_un_open; 
       ch->close= jk2_channel_un_close; 
       ch->is_stream=JK_TRUE;
  @@ -380,6 +391,7 @@
       result->setAttributeInfo=jk2_channel_un_setAttributeInfo;
       ch->mbean=result;
       result->object= ch;
  +    result->init= jk2_channel_un_init; 
   
       ch->workerEnv=env->getByName( env, "workerEnv" );
       ch->workerEnv->addChannel( env, ch->workerEnv, ch );
  
  
  
  1.45      +3 -3      jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c
  
  Index: jk_workerEnv.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- jk_workerEnv.c	16 May 2002 23:48:27 -0000	1.44
  +++ jk_workerEnv.c	26 May 2002 07:30:01 -0000	1.45
  @@ -59,7 +59,7 @@
    * Description: Workers controller                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.44 $                                           *
  + * Version:     $Revision: 1.45 $                                           *
    ***************************************************************************/
   
   #include "jk_env.h"
  @@ -221,8 +221,8 @@
   
       if( ch->mbean->disabled ) return JK_OK;
       
  -    if( ch->init != NULL ) {
  -        rc=ch->init(env, ch);
  +    if( ch->mbean->init != NULL ) {
  +        rc=ch->mbean->init(env, ch->mbean);
           if(rc!=JK_OK) {
               env->l->jkLog(env, env->l, JK_LOG_ERROR,
                             "workerEnv.initChannel() init failed for %s\n", 
  
  
  

--
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