mturk 2005/02/16 01:25:35 Modified: jk/native/common jk_lb_worker.c jk_util.c jk_util.h Log: Added disabled boolean directive to worker. This is used for hot-standby workers that can be later enabled using jkstatus console. Revision Changes Path 1.53 +3 -1 jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c Index: jk_lb_worker.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- jk_lb_worker.c 16 Feb 2005 08:30:58 -0000 1.52 +++ jk_lb_worker.c 16 Feb 2005 09:25:35 -0000 1.53 @@ -643,6 +643,8 @@ p->lb_workers[i].s->lb_value = p->lb_workers[i].s->lb_factor; p->lb_workers[i].s->in_error_state = JK_FALSE; p->lb_workers[i].s->in_recovering = JK_FALSE; + /* Worker can be initaly disabled as hot standby */ + p->lb_workers[i].s->is_disabled = jk_get_is_worker_disabled(props, worker_names[i]); if (!wc_create_worker(p->lb_workers[i].s->name, props, &(p->lb_workers[i].w), 1.57 +16 -1 jakarta-tomcat-connectors/jk/native/common/jk_util.c Index: jk_util.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_util.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- jk_util.c 16 Feb 2005 08:23:56 -0000 1.56 +++ jk_util.c 16 Feb 2005 09:25:35 -0000 1.57 @@ -65,6 +65,7 @@ #define REDIRECT_OF_WORKER ("redirect") #define MOUNT_OF_WORKER ("mount") #define METHOD_OF_WORKER ("method") +#define IS_WORKER_DISABLED ("disabled") #define DEFAULT_WORKER_TYPE JK_AJP13_WORKER_NAME #define SECRET_KEY_OF_WORKER ("secretkey") @@ -640,6 +641,20 @@ return JK_FALSE; } +int jk_get_is_worker_disabled(jk_map_t *m, const char *wname) +{ + int rc = JK_TRUE; + char buf[1024]; + if (m && wname) { + int value; + sprintf(buf, "%s.%s.%s", PREFIX_OF_WORKER, wname, IS_WORKER_DISABLED); + value = jk_map_get_bool(m, buf, 0); + if (!value) + rc = JK_FALSE; + } + return rc; +} + void jk_set_log_format(const char *logformat) { jk_log_fmt = (logformat) ? logformat : JK_TIME_FORMAT; 1.27 +3 -1 jakarta-tomcat-connectors/jk/native/common/jk_util.h Index: jk_util.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_util.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- jk_util.h 16 Feb 2005 08:23:56 -0000 1.26 +++ jk_util.h 16 Feb 2005 09:25:35 -0000 1.27 @@ -78,6 +78,8 @@ int jk_get_worker_retries(jk_map_t *m, const char *wname, int def); +int jk_get_is_worker_disabled(jk_map_t *m, const char *wname); + void jk_set_log_format(const char *logformat); int jk_get_worker_list(jk_map_t *m, char ***list, unsigned *num_of_wokers);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]