costin 02/05/03 10:39:40 Modified: jk/native2/common jk_channel_apr_socket.c jk_channel_jni.c jk_channel_socket.c Log: Call the setter on the worker for non-specific properties. Each channel is associated with an ajp worker ( later we can configure that, but at this moment we use ajp13 as the main protocol ). The load balancing parameters are set in the worker ( again, it's 1-1 relation between worker and channel, the worker is just a protocol with an associated channel ). Revision Changes Path 1.11 +7 -7 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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jk_channel_apr_socket.c 30 Apr 2002 06:49:45 -0000 1.10 +++ jk_channel_apr_socket.c 3 May 2002 17:39:40 -0000 1.11 @@ -135,10 +135,10 @@ jk_bean_t *mbean, char *name, void *valueP) { - jk_channel_t *_this=(jk_channel_t *)mbean->object; + jk_channel_t *ch=(jk_channel_t *)mbean->object; char *value=valueP; jk_channel_apr_private_t *socketInfo= - (jk_channel_apr_private_t *)(_this->_privatePtr); + (jk_channel_apr_private_t *)(ch->_privatePtr); if( strcmp( "host", name ) == 0 ) { socketInfo->host=value; @@ -148,6 +148,9 @@ socketInfo->host=value; socketInfo->type=AF_UNIX; } else { + if( ch->worker!=NULL ) { + return ch->worker->mbean->setAttribute( env, ch->worker->mbean, name, valueP ); + } return JK_ERR; } return JK_OK; @@ -258,9 +261,6 @@ int unixsock; - env->l->jkLog(env, env->l, JK_LOG_ERROR, - "channelApr.open(): can't create socket \n"); - /* UNIX socket (to be moved in APR) */ if (socketInfo->type==TYPE_UNIX) { unixsock = socket(AF_UNIX, SOCK_STREAM, 0); @@ -415,8 +415,6 @@ jk_channel_apr_data_t *chD=endpoint->channelData; - env->l->jkLog(env, env->l, JK_LOG_ERROR, - "jk2_channel_apr_send %p\n", chD); if( chD==NULL ) return JK_ERR; @@ -446,6 +444,8 @@ while(sent < len) { this_time = send(unixsock, (char *)b + sent , len - sent, 0); + env->l->jkLog(env, env->l, JK_LOG_ERROR, + "channel.apr:send() send() %d %d\n", this_time, errno); if(0 == this_time) { return -2; } 1.14 +14 -2 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.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jk_channel_jni.c 2 May 2002 03:13:05 -0000 1.13 +++ jk_channel_jni.c 3 May 2002 17:39:40 -0000 1.14 @@ -102,15 +102,27 @@ static int JK_METHOD jk2_channel_jni_setProperty(jk_env_t *env, jk_bean_t *mbean, - char *name, void *value) + char *name, void *valueP) { + jk_channel_t *ch=(jk_channel_t *)mbean->object; + char *value=valueP; + + if( ch->worker!=NULL ) { + return ch->worker->mbean->setAttribute( env, ch->worker->mbean, name, valueP ); + } return JK_OK; } static int JK_METHOD jk2_channel_jni_init(jk_env_t *env, - jk_channel_t *_this) + jk_channel_t *jniW) { + jk_workerEnv_t *wEnv=jniW->workerEnv; + if( wEnv->vm == NULL ) { + env->l->jkLog(env, env->l, JK_LOG_INFO, + "channel_jni.init() no VM found\n" ); + return JK_ERR; + } return JK_OK; } 1.21 +4 -1 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.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- jk_channel_socket.c 25 Apr 2002 18:49:37 -0000 1.20 +++ jk_channel_socket.c 3 May 2002 17:39:40 -0000 1.21 @@ -131,7 +131,10 @@ } else if( strcmp( "port", name ) == 0 ) { socketInfo->port=atoi( value ); } else { - return JK_ERR; + if( ch->worker!=NULL ) { + return ch->worker->mbean->setAttribute( env, ch->worker->mbean, name, valueP ); + } + return JK_ERR; } return JK_OK; }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>