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_socket.c jk_config.c
Date Thu, 25 Apr 2002 18:49:37 GMT
costin      02/04/25 11:49:37

  Modified:    jk/native2/common jk_channel_socket.c jk_config.c
  Log:
  Update return codes.
  
  Revision  Changes    Path
  1.20      +16 -16    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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_channel_socket.c	12 Apr 2002 21:49:03 -0000	1.19
  +++ jk_channel_socket.c	25 Apr 2002 18:49:37 -0000	1.20
  @@ -131,9 +131,9 @@
       } else if( strcmp( "port", name ) == 0 ) {
           socketInfo->port=atoi( value );
       } else {
  -	return JK_FALSE;
  +	return JK_ERR;
       }
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
  @@ -180,7 +180,7 @@
           socketInfo->host=DEFAULT_HOST;
       
       rc=jk2_channel_socket_resolve( env, socketInfo->host, socketInfo->port, &socketInfo->addr
);
  -    if( rc!= JK_TRUE ) {
  +    if( rc!= JK_OK ) {
   	env->l->jkLog(env, env->l, JK_LOG_ERROR, "jk2_channel_socket_init: "
                         "can't resolve %s:%d errno=%d\n", socketInfo->host, socketInfo->port,
errno );
       }
  @@ -213,7 +213,7 @@
           /* If we found also characters we use gethostbyname()*/
           struct hostent *hoste = gethostbyname(host);
           if(!hoste) {
  -            return JK_FALSE;
  +            return JK_ERR;
           }
   
           laddr = ((struct in_addr *)hoste->h_addr_list[0])->s_addr;
  @@ -223,7 +223,7 @@
       }
       memcpy(&(rc->sin_addr), &laddr , sizeof(laddr));
   
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   static int jk2_close_socket(jk_env_t *env, int s)
  @@ -268,7 +268,7 @@
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                    "channelSocket.open(): can't create socket %d %s\n",
                    errno, strerror( errno ) );
  -        return JK_FALSE;
  +        return JK_ERR;
       }
   
       /* Tries to connect to JServ (continues trying while error is EINTR) */
  @@ -292,7 +292,7 @@
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "channelSocket.connect() connect failed %s:%d %d %s \n",
                         socketInfo->host, socketInfo->port, errno, strerror( errno
) );
  -        return JK_FALSE;
  +        return JK_ERR;
       }
   
       if(ndelay) {
  @@ -313,7 +313,7 @@
           }
           sd->sock=sock;
       }
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   
  @@ -325,7 +325,7 @@
       int sd;
       jk_channel_socket_data_t *chD=endpoint->channelData;
       if( chD==NULL ) 
  -	return JK_FALSE;
  +	return JK_ERR;
   
       sd=chD->sock;
       chD->sock=-1;
  @@ -357,7 +357,7 @@
       jk_channel_socket_data_t *chD=endpoint->channelData;
   
       if( chD==NULL ) 
  -	return JK_FALSE;
  +	return JK_ERR;
   
       msg->end( env, msg );
       len=msg->len;
  @@ -376,7 +376,7 @@
   	sent += this_time;
       }
       /*     return sent; */
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   
  @@ -398,7 +398,7 @@
       int rdlen;
   
       if( chD==NULL ) 
  -	return JK_FALSE;
  +	return JK_ERR;
       sd=chD->sock;
       rdlen = 0;
       
  @@ -451,7 +451,7 @@
       if( blen < 0 ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "channelSocket.receive(): Bad header\n" );
  -        return JK_FALSE;
  +        return JK_ERR;
       }
       
       rc= jk2_channel_socket_readN( env, ch, endpoint, msg->buf + hlen, blen);
  @@ -460,13 +460,13 @@
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                  "channelSocket.receive(): Error receiving message body %d %d\n",
                         rc, errno);
  -        return JK_FALSE;
  +        return JK_ERR;
       }
   
       env->l->jkLog(env, env->l, JK_LOG_INFO,
                     "channelSocket.receive(): Received len=%d type=%d\n",
                     blen, (int)msg->buf[hlen]);
  -    return JK_TRUE;
  +    return JK_OK;
   
   }
   
  @@ -499,5 +499,5 @@
       ch->workerEnv=env->getByName( env, "workerEnv" );
       ch->workerEnv->addChannel( env, ch->workerEnv, ch );
   
  -    return JK_TRUE;
  +    return JK_OK;
   }
  
  
  
  1.12      +31 -31    jakarta-tomcat-connectors/jk/native2/common/jk_config.c
  
  Index: jk_config.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_config.c	12 Apr 2002 23:08:45 -0000	1.11
  +++ jk_config.c	25 Apr 2002 18:49:37 -0000	1.12
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: General purpose config object                                 *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.11 $                                           *
  + * Version:     $Revision: 1.12 $                                           *
    ***************************************************************************/
   
   #include "jk_global.h"
  @@ -96,7 +96,7 @@
       if (stat(workerFile, &statbuf) == -1) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "config.setConfig(): Can't find config file %s", workerFile );
  -        return JK_FALSE;
  +        return JK_ERR;
       }
   
       cfg->file=workerFile;
  @@ -110,7 +110,7 @@
       
       err=jk2_config_read(env, cfg, props, workerFile );
       
  -    if( err==JK_TRUE ) {
  +    if( err==JK_OK ) {
           env->l->jkLog(env, env->l, JK_LOG_INFO, 
                         "config.setConfig():  Reading properties %s %d\n",
                         workerFile, props->size( env, props ) );
  @@ -118,7 +118,7 @@
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "config.setConfig(): Error reading properties %s\n",
                         workerFile );
  -        return JK_FALSE;
  +        return JK_ERR;
       }
   
       for( i=0; i<props->size( env, props); i++ ) {
  @@ -128,7 +128,7 @@
           cfg->setPropertyString( env, cfg, name, val );
       }
       
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   /* Experimental. Dangerous. The file param will go away, for security
  @@ -146,7 +146,7 @@
       fp= fopen(workerFile, "w");
           
       if(fp==NULL)
  -        return JK_FALSE;
  +        return JK_ERR;
   
       /* We'll save only the objects/properties that were set
          via config, and to the original 'string'. That keeps the config
  @@ -176,7 +176,7 @@
       
       fclose(fp);
   
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   
  @@ -218,7 +218,7 @@
       if( lastDot==NULL || lastDot < lastDot1 )
           lastDot=lastDot1;
       
  -    if( lastDot==NULL || *lastDot=='\0' ) return JK_FALSE;
  +    if( lastDot==NULL || *lastDot=='\0' ) return JK_ERR;
   
       *lastDot='\0';
       lastDot++;
  @@ -228,7 +228,7 @@
   
       /*     fprintf(stderr, "ProcessBeanProperty string %s %s\n", *objName, *propertyName);
*/
       
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   
  @@ -240,7 +240,7 @@
       @param val the value, $(property) will be replaced.
    */
   int jk2_config_setProperty(jk_env_t *env, jk_config_t *cfg,
  -                           jk_bean_t *mbean, char *name, void *val)
  +                           jk_bean_t *mbean, char *name, char *val)
   {
       char *pname;
       if( mbean == cfg->mbean ) {
  @@ -275,12 +275,12 @@
       /*     env->l->jkLog( env, env->l, JK_LOG_INFO, "config: set %s / %s / %s=%s\n",
*/
       /*                    mbean->name, name, pname, val); */
       if( strcmp( name, "name" ) == 0 ) {
  -        return JK_TRUE;
  +        return JK_OK;
       }
       
       if(mbean->setAttribute)
           return mbean->setAttribute( env, mbean, name, val );
  -    return JK_FALSE;
  +    return JK_ERR;
   }
   
   int jk2_config_setPropertyString(jk_env_t *env, jk_config_t *cfg,
  @@ -297,7 +297,7 @@
       /* fprintf( stderr, "setPropertyString %s %s \n", name, value ); */
   
       status=jk2_config_processBeanPropertyString(env, cfg, name, &objName, &propName
);
  -    if( status!=JK_TRUE ) {
  +    if( status!=JK_OK ) {
           /* Unknown properties ends up in our config, as 'unclaimed' or global */
           cfg->setProperty( env, cfg, cfg->mbean, name, value );
           return status;
  @@ -311,7 +311,7 @@
       if( mbean == NULL ) {
           /* Can't create it, save the value in our map */
           cfg->setProperty( env, cfg, cfg->mbean, name, value );
  -        return JK_FALSE;
  +        return JK_ERR;
       }
   
       if( mbean->settings == NULL )
  @@ -336,14 +336,14 @@
       char *val=jk2_config_getString( env, conf, prop, (char *)def );
   
       if( val==NULL )
  -        return JK_FALSE;
  +        return JK_ERR;
   
       if( strcmp( val, "1" ) == 0 ||
           strcasecmp( val, "TRUE" ) == 0 ||
           strcasecmp( val, "ON" ) == 0 ) {
  -        return JK_TRUE;
  +        return JK_OK;
       }
  -    return JK_FALSE;
  +    return JK_ERR;
   }
   
   /** Get a string property, using the worker's style
  @@ -486,13 +486,13 @@
   /*  Reading / parsing */
   int jk2_config_parseProperty(jk_env_t *env, jk_config_t *cfg, jk_map_t *m, char *prp )
   {
  -    int rc = JK_FALSE;
  +    int rc = JK_ERR;
       char *v;
           
       jk2_trim_prp_comment(prp);
       
       if( jk2_trim(prp)==0 )
  -        return JK_TRUE;
  +        return JK_OK;
   
       /* Support windows-style 'sections' - for cleaner config
        */
  @@ -509,18 +509,18 @@
           strcat( dummyProp, ".name");
           m->add( env, m, dummyProp, cfg->section);
   
  -        return JK_TRUE;
  +        return JK_OK;
       }
       
       v = strchr(prp, '=');
       if(v==NULL)
  -        return JK_TRUE;
  +        return JK_OK;
           
       *v = '\0';
       v++;                        
       
       if(strlen(v)==0 || strlen(prp)==0)
  -        return JK_TRUE;
  +        return JK_OK;
   
       /* [ ] Shortcut */
       if( cfg->section != NULL ) {
  @@ -545,7 +545,7 @@
       m->add( env, m, cfg->pool->pstrdup(env, cfg->pool, prp),
               cfg->pool->pstrdup(env, cfg->pool, v));
   
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   /** Read a query string into the map
  @@ -574,7 +574,7 @@
                   cfg->pool->pstrdup( env, cfg->pool, value ));
           qry=sep;
       }
  -    return JK_TRUE;
  +    return JK_OK;
   }
        
   int jk2_config_read(jk_env_t *env, jk_config_t *cfg, jk_map_t *m, const char *f)
  @@ -585,12 +585,12 @@
   //    char *v;
           
       if(m==NULL || f==NULL )
  -        return JK_FALSE;
  +        return JK_ERR;
   
       fp= fopen(f, "r");
           
       if(fp==NULL)
  -        return JK_FALSE;
  +        return JK_ERR;
   
       cfg->section=NULL;
       while(NULL != (prp = fgets(buf, LENGTH_OF_LINE, fp))) {
  @@ -598,7 +598,7 @@
       }
   
       fclose(fp);
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   /** For multi-value properties, return the concatenation
  @@ -785,9 +785,9 @@
           */
           return jk2_config_saveConfig(env, cfg, cfg->workerEnv, value);
       } else {
  -        return JK_FALSE;
  +        return JK_ERR;
       }
  -    return JK_TRUE;
  +    return JK_OK;
   }
   
   
  @@ -826,7 +826,7 @@
   
       _this=(jk_config_t *)pool->alloc(env, pool, sizeof(jk_config_t));
       if( _this == NULL )
  -        return JK_FALSE;
  +        return JK_ERR;
       _this->pool = pool;
   
       _this->setPropertyString=jk2_config_setPropertyString;
  @@ -836,5 +836,5 @@
       result->object=_this;
       result->setAttribute=jk2_config_setAttribute;
   
  -    return JK_TRUE;
  +    return JK_OK;
   }
  
  
  

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