You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/03/26 04:00:09 UTC
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_config.c jk_logger_file.c
costin 02/03/25 19:00:09
Modified: jk/native2/common jk_config.c jk_logger_file.c
Log:
Store the name of the config file ( to write back modified info )
Add the vargs method in logger.
Revision Changes Path
1.7 +8 -3 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- jk_config.c 25 Mar 2002 03:35:11 -0000 1.6
+++ jk_config.c 26 Mar 2002 03:00:09 -0000 1.7
@@ -58,7 +58,7 @@
/***************************************************************************
* Description: General purpose config object *
* Author: Gal Shachor <sh...@il.ibm.com> *
- * Version: $Revision: 1.6 $ *
+ * Version: $Revision: 1.7 $ *
***************************************************************************/
#include "jk_global.h"
@@ -98,6 +98,8 @@
"config.setConfig(): Can't find config file %s", workerFile );
return JK_FALSE;
}
+
+ cfg->file=workerFile;
/** Read worker files
*/
@@ -270,7 +272,10 @@
/* 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;
+ }
+
if(mbean->setAttribute)
return mbean->setAttribute( env, mbean, name, val );
return JK_FALSE;
@@ -296,7 +301,7 @@
return status;
}
- mbean=env->getMBean( env, objName );
+ mbean=env->getBean( env, objName );
if( mbean==NULL ) {
mbean=env->createBean( env, cfg->pool, objName );
}
1.16 +26 -10 jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c
Index: jk_logger_file.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- jk_logger_file.c 23 Mar 2002 17:23:15 -0000 1.15
+++ jk_logger_file.c 26 Mar 2002 03:00:09 -0000 1.16
@@ -59,7 +59,7 @@
* Description: Utility functions (mainly configuration) *
* Author: Gal Shachor <sh...@il.ibm.com> *
* Author: Henri Gomez <hg...@slib.fr> *
- * Version: $Revision: 1.15 $ *
+ * Version: $Revision: 1.16 $ *
***************************************************************************/
#include "jk_env.h"
@@ -204,15 +204,16 @@
}
-static int jk2_logger_file_jkLog(jk_env_t *env, jk_logger_t *l,
- const char *file,
- int line,
- int level,
- const char *fmt, ...)
+static int jk2_logger_file_jkVLog(jk_env_t *env, jk_logger_t *l,
+ const char *file,
+ int line,
+ int level,
+ char *fmt,
+ va_list args)
{
int rc = 0;
- if( !file || !fmt) {
+ if( !file || !args) {
return -1;
}
@@ -226,7 +227,6 @@
char buf[HUGE_BUFFER_SIZE];
#endif
char *f = (char *)(file + strlen(file) - 1);
- va_list args;
int used = 0;
while(f != file && '\\' != *f && '/' != *f) {
@@ -260,7 +260,6 @@
return 0; /* [V] not sure what to return... */
}
- va_start(args, fmt);
#ifdef WIN32
rc = _vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args);
#elif defined(NETWARE) /* until we get a vsnprintf function */
@@ -268,7 +267,6 @@
#else
rc = vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args);
#endif
- va_end(args);
l->log(env, l, level, buf);
#ifdef NETWARE
@@ -280,6 +278,23 @@
}
+
+static int jk2_logger_file_jkLog(jk_env_t *env, jk_logger_t *l,
+ const char *file,
+ int line,
+ int level,
+ const char *fmt, ...)
+{
+ va_list args;
+ int rc;
+
+ va_start(args, fmt);
+ rc=jk2_logger_file_jkVLog( env, l, file, line, level, fmt, args );
+ va_end(args);
+
+ return rc;
+}
+
int jk2_logger_file_factory(jk_env_t *env, jk_pool_t *pool,
jk_bean_t *result,
const char *type, const char *name)
@@ -294,6 +309,7 @@
l->logger_private = NULL;
l->init =jk2_logger_file_init;
l->jkLog = jk2_logger_file_jkLog;
+ l->jkVLog = jk2_logger_file_jkVLog;
l->level=JK_LOG_ERROR_LEVEL;
jk2_logger_file_logFmt = JK_TIME_FORMAT;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>