costin      2003/02/28 12:36:52

  Modified:    jk/native2/common jk_worker_status.c
  Log:
  Few fixes and changes to make parsing faster. Since : is used for port and type/name 
separator.
  I use | as delimiter.
  
  Revision  Changes    Path
  1.35      +14 -12    jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c
  
  Index: jk_worker_status.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- jk_worker_status.c        28 Feb 2003 05:02:24 -0000      1.34
  +++ jk_worker_status.c        28 Feb 2003 20:36:52 -0000      1.35
  @@ -432,10 +432,11 @@
           qryLen=strlen( cName );
       }
       if( qryLen >0 ) {
  -        if( cName[strlen(cName)] == '*' ) {
  +        if( cName[strlen(cName)-1] == '*' ) {
               printf("Exact match off %s\n", cName );
  -            cName[strlen(cName)]='\0';
  +            cName[strlen(cName)-1]='\0';
               exact=0;
  +            qryLen--;
           }
       }
       for( i=0; i < env->_objects->size( env, env->_objects ); i++ ) {
  @@ -449,7 +450,7 @@
               continue;
           
           /* Prefix */
  -        if( ! exact  && qryLen != 0 && strncmp( name, cName, qryLen )!= 0 )
  +        if( (! exact)  && qryLen != 0 && strncmp( name, cName, qryLen )!= 0 )
               continue;
           
           /* Exact */
  @@ -458,15 +459,15 @@
           
           if( mbean==NULL ) 
               continue;
  -        s->jkprintf(env, s, "N:%s:%s\n", mbean->type, name);
  +        s->jkprintf(env, s, "N|%s|%s\n", mbean->type, name);
           
           while( getAtt != NULL && *getAtt != NULL && **getAtt!='\0' ) {
  -            s->jkprintf(env, s, "G:%s:%s\n", name, *getAtt);
  +            s->jkprintf(env, s, "G|%s|%s\n", name, *getAtt);
               getAtt++;
           }
           
           while( setAtt != NULL && *setAtt != NULL && **setAtt!='\0' ) {
  -            s->jkprintf(env, s, "S:%s:%s\n", name, *setAtt);
  +            s->jkprintf(env, s, "S|%s|%s\n", name, *setAtt);
               setAtt++;
           }
           
  @@ -491,10 +492,11 @@
           qryLen=strlen( cName );
       }
       if( qryLen >0 ) {
  -        if( cName[strlen(cName)] == '*' ) {
  +        if( cName[strlen(cName)-1] == '*' ) {
               printf("Exact match off %s\n", cName );
  -            cName[strlen(cName)]='\0';
  +            cName[strlen(cName)-1]='\0';
               exact=0;
  +            qryLen--;
           }
       }
       for( i=0; i < env->_objects->size( env, env->_objects ); i++ ) {
  @@ -517,12 +519,12 @@
           
           if( mbean==NULL ) 
               continue;
  -        s->jkprintf(env, s, "P:%s:%s:%lp\n", mbean->type, name, mbean->object );
  +        s->jkprintf(env, s, "P|%s|%s|%lp\n", mbean->type, name, mbean->object );
           
           while( getAtt != NULL && *getAtt != NULL && **getAtt!='\0' ) {
               char *attName=*getAtt;
               char *val=mbean->getAttribute(env, mbean, *getAtt );
  -            s->jkprintf(env, s, "G:%s:%s:%s\n", name, *getAtt, (val==NULL)? "NULL": 
val);
  +            s->jkprintf(env, s, "G|%s|%s|%s\n", name, *getAtt, (val==NULL)? "NULL": 
val);
                   getAtt++;
           }
       }
  @@ -554,7 +556,7 @@
           if( strcmp( name, cName ) == 0 &&
               mbean->getAttribute != NULL ) {
               void *result=mbean->getAttribute( env, mbean, attName );
  -            s->jkprintf( env, s, "OK:%s:%s", cName, attName );
  +            s->jkprintf( env, s, "OK|%s|%s", cName, attName );
               s->jkprintf( env, s, "%s", result );
               return JK_OK;
           }
  @@ -596,7 +598,7 @@
           if( strcmp( name, cName ) == 0 &&
               mbean->setAttribute != NULL ) {
               int res=mbean->setAttribute( env, mbean, attName, attVal );
  -            s->jkprintf( env, s, "OK:%s:%s:%d", cName, attName, res );
  +            s->jkprintf( env, s, "OK|%s|%s|%d", cName, attName, res );
               return JK_OK;
           }
       }
  
  
  

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

Reply via email to