costin      02/04/11 12:30:24

  Modified:    jk/native2/common jk_channel_jni.c jk_channel_socket.c
  Log:
  Fix initialization.
  
  Revision  Changes    Path
  1.6       +17 -14    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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_channel_jni.c  18 Mar 2002 18:25:05 -0000      1.5
  +++ jk_channel_jni.c  11 Apr 2002 19:30:23 -0000      1.6
  @@ -592,26 +592,29 @@
                                         jk_bean_t *result,
                                         const char *type, const char *name)
   {
  -    jk_channel_t *_this=result->object;
  +    jk_channel_t *ch=result->object;
       
  -    _this=(jk_channel_t *)pool->calloc(env, pool, sizeof( jk_channel_t));
  +    ch=(jk_channel_t *)pool->calloc(env, pool, sizeof( jk_channel_t));
       
  -    _this->recv= jk2_channel_jni_recv;
  -    _this->send= jk2_channel_jni_send; 
  -    _this->init= jk2_channel_jni_init; 
  -    _this->open= jk2_channel_jni_open; 
  -    _this->close= jk2_channel_jni_close; 
  +    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; 
   
  -    _this->beforeRequest= jk2_channel_jni_beforeRequest;
  -    _this->afterRequest= jk2_channel_jni_afterRequest;
  +    ch->beforeRequest= jk2_channel_jni_beforeRequest;
  +    ch->afterRequest= jk2_channel_jni_afterRequest;
       
  -    _this->_privatePtr=(jk_channel_jni_private_t *)pool->calloc(env, pool,
  +    ch->_privatePtr=(jk_channel_jni_private_t *)pool->calloc(env, pool,
                       sizeof(jk_channel_jni_private_t));
  -    _this->is_stream=JK_FALSE;
  +    ch->is_stream=JK_FALSE;
       
       result->setAttribute= jk2_channel_jni_setProperty;
  -    _this->mbean=result;
  -    result->object= _this;
  -    
  +    ch->mbean=result;
  +    result->object= ch;
  +
  +    ch->workerEnv=env->getByName( env, "workerEnv" );
  +    ch->workerEnv->addChannel( env, ch->workerEnv, ch );
  +
       return JK_TRUE;
   }
  
  
  
  1.18      +6 -23     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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_channel_socket.c       26 Mar 2002 02:58:30 -0000      1.17
  +++ jk_channel_socket.c       11 Apr 2002 19:30:23 -0000      1.18
  @@ -162,7 +162,7 @@
                   socketInfo->port=atoi( portIdx );
               }
               if( socketInfo->host==NULL ) {
  -                socketInfo->host=ch->pool->calloc( env, ch->pool, strlen( localName 
) + 1 );
  +                socketInfo->host=ch->mbean->pool->calloc( env, ch->mbean->pool, 
strlen( localName ) + 1 );
                   if( portIdx==NULL ) {
                       strcpy( socketInfo->host, localName );
                   } else {
  @@ -185,26 +185,8 @@
                         "can't resolve %s:%d errno=%d\n", socketInfo->host, 
socketInfo->port, errno );
       }
   
  -    if( ch->worker == NULL ) {
  -        jk_bean_t *jkb;
  -        
  -        env->l->jkLog(env, env->l, JK_LOG_INFO,
  -                      "channel_socket.init(): create default worker for %s\n", 
ch->mbean->name );
  -        
  -        jkb=env->createBean2(env, ch->pool, "worker.ajp13", ch->mbean->localName );
  -        ch->worker=jkb->object;
  -        ch->worker->channelName=ch->mbean->name;
  -        ch->worker->channel=ch;
  -
  -        /* XXX Set additional parameters - use defaults otherwise */
  -
  -        ch->worker->init( env, ch->worker);
  -    }
  -    
       env->l->jkLog(env, env->l, JK_LOG_INFO,
  -                  "channel_socket.init(): %s:%d for %s\n", socketInfo->host,
  -                  socketInfo->port, ch->worker->mbean->name );
  -
  +                  "channel_socket.init(): %s:%d \n", socketInfo->host, 
socketInfo->port );
       
       return rc;
   }
  @@ -502,7 +484,6 @@
       ch->_privatePtr= (jk_channel_socket_private_t *)
        pool->calloc( env, pool, sizeof( jk_channel_socket_private_t));
   
  -    ch->pool=pool;
       ch->recv= jk2_channel_socket_recv; 
       ch->send= jk2_channel_socket_send; 
       ch->init= jk2_channel_socket_init; 
  @@ -511,10 +492,12 @@
   
       ch->is_stream=JK_TRUE;
   
  -
       result->setAttribute= jk2_channel_socket_setAttribute; 
       result->object= ch;
       ch->mbean=result;
  -    
  +
  +    ch->workerEnv=env->getByName( env, "workerEnv" );
  +    ch->workerEnv->addChannel( env, ch->workerEnv, ch );
  +
       return JK_TRUE;
   }
  
  
  

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

Reply via email to