cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp12_worker.c

2005-02-16 Thread mturk
mturk   2005/02/16 00:15:56

  Modified:jk/native/common jk_ajp12_worker.c
  Log:
  Added missing semicolon for AS400 build.
  
  Revision  ChangesPath
  1.23  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
  
  Index: jk_ajp12_worker.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_ajp12_worker.c 15 Feb 2005 08:52:53 -  1.22
  +++ jk_ajp12_worker.c 16 Feb 2005 08:15:56 -  1.23
  @@ -319,7 +319,7 @@
   #if defined(AS400) || defined(_OSD_POSIX)
   char buf[2048];
   if (bufferlen  2048) {
  -memcpy(buf, buffer, bufferlen)
  +memcpy(buf, buffer, bufferlen);
   jk_xlate_to_ascii(buf, bufferlen);
   return ajpv12_sendnbytes(p, buf, bufferlen);
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 00:19:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Rewrite endpoint cache. The endpoints are now created on init,
  and are present for worker liftime. This also truly limits the number
  of connections to Tomcat.
  
  Revision  ChangesPath
  1.79  +155 -154  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- jk_ajp_common.c   15 Feb 2005 12:11:20 -  1.78
  +++ jk_ajp_common.c   16 Feb 2005 08:19:46 -  1.79
  @@ -682,8 +682,15 @@
* Reset the endpoint (clean buf)
*/
   
  -static void ajp_reset_endpoint(ajp_endpoint_t * ae)
  +static void ajp_reset_endpoint(ajp_endpoint_t * ae, jk_logger_t *l)
   {
  +if (ae-sd  0  !ae-reuse) {
  +jk_close_socket(ae-sd);
  +if (JK_IS_DEBUG_LEVEL(l))
  +jk_log(l, JK_LOG_DEBUG,
  +   closed socket with sd = %d, ae-sd);
  +ae-sd = -1;
  +}
   jk_reset_pool((ae-pool));
   }
   
  @@ -699,7 +706,8 @@
   jk_close_socket(ae-sd);
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  -   closed sd = %d, ae-sd);
  +   closed socket with sd = %d, ae-sd);
  +ae-sd = -1;
   }
   
   jk_close_pool((ae-pool));
  @@ -709,35 +717,31 @@
   
   
   /*
  - * Try to reuse a previous connection
  + * Try another connection from cache
*/
   
  -static void ajp_reuse_connection(ajp_endpoint_t * ae, jk_logger_t *l)
  +static void ajp_next_connection(ajp_endpoint_t **ae, jk_logger_t *l)
   {
  -ajp_worker_t *aw = ae-worker;
  +int rc;
  +ajp_worker_t *aw = (*ae)-worker;
   
   /* Close existing endpoint socket */
  -jk_close_socket(ae-sd);
  -ae-sd = -1;
  -
  -if (aw-ep_cache_sz) {
  -int rc;
  -JK_ENTER_CS(aw-cs, rc);
  -if (rc) {
  -unsigned i;
  +jk_close_socket((*ae)-sd);
  +(*ae)-sd = -1;
   
  -for (i = 0; i  aw-ep_cache_sz; i++) {
  -/* Find cache slot with usable socket */
  -if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  -ae-sd = aw-ep_cache[i]-sd;
  -aw-ep_cache[i]-sd = -1;
  -ajp_close_endpoint(aw-ep_cache[i], l);
  -aw-ep_cache[i] = NULL;
  -break;
  -}
  +JK_ENTER_CS(aw-cs, rc);
  +if (rc) {
  +unsigned int i;
  +for (i = 0; i  aw-ep_cache_sz; i++) {
  +/* Find cache slot with usable socket */
  +if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  +ajp_endpoint_t *e = aw-ep_cache[i];
  +aw-ep_cache[i] = *ae;
  +*ae = e;
  +break;
   }
  -JK_LEAVE_CS(aw-cs, rc);
   }
  +JK_LEAVE_CS(aw-cs, rc);
   }
   }
   
  @@ -1157,9 +1161,9 @@
* loop. */
   if (err ||
   (ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE)) {
  -jk_log(l, JK_LOG_ERROR,
  -   Error sending request try another pooled connection);
  -ajp_reuse_connection(ae, l);
  +jk_log(l, JK_LOG_INFO,
  +   Error sending request. Will try another pooled 
connection);
  +ajp_next_connection(ae, l);
   }
   else
   break;
  @@ -1366,9 +1370,7 @@
   /*
* Strange protocol error.
*/
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG, Reuse: %d, ae-reuse);
  -ae-reuse = JK_FALSE;
  +jk_log(l, JK_LOG_INFO,  Protocol error: Reuse is set to 
false);
   }
   /* Reuse in all cases */
   ae-reuse = JK_TRUE;
  @@ -1630,7 +1632,6 @@
   
   /* Up to there we can recover */
   *is_recoverable_error = JK_TRUE;
  -op-recoverable = JK_TRUE;
   
   err = ajp_get_reply(e, s, l, p, op);
   if (err  0) {
  @@ -1662,7 +1663,7 @@
   }
   }
   /* Get another connection from the pool */
  -ajp_reuse_connection(p, l);
  +ajp_next_connection(p, l);
   
   if (err == JK_CLIENT_ERROR) {
   *is_recoverable_error = JK_FALSE;
  @@ -1752,12 +1753,28 @@
   return JK_FALSE;
   }
   
  +static ajp_endpoint_t *ajp_create_endpoint(jk_worker_t *w, int proto, time_t 
now)
  +{
  +ajp_endpoint_t *ae = (ajp_endpoint_t *)calloc(1, sizeof(ajp_endpoint_t));
  +if (ae) {
  +ae-sd = -1;
  +ae-reuse = JK_FALSE;
  +  

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.h

2005-02-16 Thread mturk
mturk   2005/02/16 00:20:59

  Modified:jk/native/common jk_ajp_common.h
  Log:
  Use unsigned int instead just unsigned. No functional change.
  
  Revision  ChangesPath
  1.30  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- jk_ajp_common.h   14 Feb 2005 17:24:09 -  1.29
  +++ jk_ajp_common.h   16 Feb 2005 08:20:59 -  1.30
  @@ -303,7 +303,7 @@
   
   jk_endpoint_t endpoint;
   
  -unsigned left_bytes_to_send;
  +unsigned int left_bytes_to_send;
   
   /* time of the last request
  handled by this endpoint */
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_util.c jk_util.h

2005-02-16 Thread mturk
mturk   2005/02/16 00:23:56

  Modified:jk/native/common jk_util.c jk_util.h
  Log:
  Removed local_worker and local_worker_only.
  Added sticky_session_force, redirect and lb method.
  
  Revision  ChangesPath
  1.56  +24 -16jakarta-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.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- jk_util.c 14 Feb 2005 07:57:41 -  1.55
  +++ jk_util.c 16 Feb 2005 08:23:56 -  1.56
  @@ -26,6 +26,7 @@
   #include jk_ajp12_worker.h
   #include jk_ajp13_worker.h
   #include jk_ajp14_worker.h
  +#include jk_lb_worker.h
   #include jk_mt.h
   
   #define SYSPROPS_OF_WORKER  (sysprops)
  @@ -59,10 +60,11 @@
   #define BALANCED_WORKERS(balanced_workers)
   #define BALANCE_WORKERS (balance_workers)
   #define STICKY_SESSION  (sticky_session)
  -#define LOCAL_WORKER_ONLY_FLAG  (local_worker_only)
  -#define LOCAL_WORKER_FLAG   (local_worker)
  +#define STICKY_SESSION_FORCE(sticky_session_force)
   #define DOMAIN_OF_WORKER(domain)
  +#define REDIRECT_OF_WORKER  (redirect)
   #define MOUNT_OF_WORKER (mount)
  +#define METHOD_OF_WORKER(method)
   
   #define DEFAULT_WORKER_TYPE JK_AJP13_WORKER_NAME
   #define SECRET_KEY_OF_WORKER(secretkey)
  @@ -363,6 +365,16 @@
   return jk_map_get_string(m, buf, def);
   }
   
  +const char *jk_get_worker_redirect(jk_map_t *m, const char *wname, const 
char *def)
  +{
  +char buf[1024];
  +if (!m || !wname) {
  +return NULL;
  +}
  +sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname, REDIRECT_OF_WORKER);
  +return jk_map_get_string(m, buf, def);
  +}
  +
   const char *jk_get_worker_secret(jk_map_t *m, const char *wname)
   {
   char buf[1024];
  @@ -441,7 +453,7 @@
   static int def_cache_size = -1;
   int jk_get_worker_def_cache_size(int protocol)
   {
  -if (def_cache_size  0) {
  +if (def_cache_size  1) {
   if (protocol == AJP14_PROTO)
   def_cache_size = AJP14_DEF_CACHE_SZ;
   else 
  @@ -660,13 +672,13 @@
   return rc;
   }
   
  -int jk_get_is_local_worker(jk_map_t *m, const char *wname)
  +int jk_get_is_sticky_session_force(jk_map_t *m, const char *wname)
   {
   int rc = JK_FALSE;
   char buf[1024];
   if (m  wname) {
   int value;
  -sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname, LOCAL_WORKER_FLAG);
  +sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname, 
STICKY_SESSION_FORCE);
   value = jk_map_get_bool(m, buf, 0);
   if (value)
   rc = JK_TRUE;
  @@ -674,19 +686,15 @@
   return rc;
   }
   
  -int jk_get_local_worker_only_flag(jk_map_t *m, const char *lb_wname)
  +int jk_get_lb_method(jk_map_t *m, const char *wname)
   {
  -int rc = JK_FALSE;
   char buf[1024];
  -if (m  lb_wname) {
  -int value;
  -sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, lb_wname,
  -LOCAL_WORKER_ONLY_FLAG);
  -value = jk_map_get_bool(m, buf, 0);
  -if (value)
  -rc = JK_TRUE;
  +if (!m || !wname) {
  +return DEFAULT_LB_FACTOR;
   }
  -return rc;
  +
  +sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname, METHOD_OF_WORKER);
  +return jk_map_get_int(m, buf, JK_LB_BYREQUESTS);
   }
   
   int jk_get_lb_worker_list(jk_map_t *m,
  
  
  
  1.26  +5 -3  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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- jk_util.h 12 Feb 2005 19:26:42 -  1.25
  +++ jk_util.h 16 Feb 2005 08:23:56 -  1.26
  @@ -72,6 +72,8 @@
   
   const char *jk_get_worker_domain(jk_map_t *m, const char *wname, const char 
*def);
   
  +const char *jk_get_worker_redirect(jk_map_t *m, const char *wname, const 
char *def);
  +
   const char *jk_get_worker_secret_key(jk_map_t *m, const char *wname);
   
   int jk_get_worker_retries(jk_map_t *m, const char *wname, int def);
  @@ -84,9 +86,9 @@
   
   int jk_get_is_sticky_session(jk_map_t *m, const char *wname);
   
  -int jk_get_is_local_worker(jk_map_t *m, const char *wname);
  +int jk_get_is_sticky_session_force(jk_map_t *m, const char *wname);
   
  -int jk_get_local_worker_only_flag(jk_map_t *m, const char *lb_wname);
  +int jk_get_lb_method(jk_map_t *m, const char *wname);
   
   int jk_get_lb_worker_list(jk_map_t *m,
 const char *lb_wname,
  
  
  

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

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_shm.h

2005-02-16 Thread mturk
mturk   2005/02/16 00:25:10

  Modified:jk/native/common jk_shm.h
  Log:
  Removed all local_* parameters.
  
  Revision  ChangesPath
  1.11  +2 -9  jakarta-tomcat-connectors/jk/native/common/jk_shm.h
  
  Index: jk_shm.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_shm.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_shm.h  15 Feb 2005 08:51:43 -  1.10
  +++ jk_shm.h  16 Feb 2005 08:25:10 -  1.11
  @@ -71,14 +71,7 @@
   /* Current lb factor */
   int lb_factor;
   /* Current lb value  */
  -int lb_value;
  -
  -/* Those are going to be deprecated */
  -int is_local_worker;
  -int is_local_domain;
  -int in_local_worker_mode;
  -int local_worker_only;
  -
  +int lb_value;
   int in_error_state;
   int in_recovering;
   int sticky_session;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c jk_lb_worker.h

2005-02-16 Thread mturk
mturk   2005/02/16 00:27:53

  Modified:jk/native/common jk_lb_worker.c jk_lb_worker.h
  Log:
  Rewrite load balancer. Added byrequest and bytraffic methods.
  Also keep session and domain models. Added sticky_session_force,
  for non replicated Tomcats.
  
  Revision  ChangesPath
  1.51  +264 -277  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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- jk_lb_worker.c15 Feb 2005 08:52:53 -  1.50
  +++ jk_lb_worker.c16 Feb 2005 08:27:52 -  1.51
  @@ -42,16 +42,6 @@
   #define WAIT_BEFORE_RECOVER (60*1)
   #define WORKER_RECOVER_TIME (recover_time)
   
  -static const char *search_types[] = {
  -any,
  -sticky,
  -redirect,
  -sticky domain,
  -local,
  -local domain,
  -NULL
  -};
  -
   struct lb_endpoint
   {
   jk_endpoint_t *e;
  @@ -173,160 +163,223 @@
   }
   }
   
  +static void retry_worker(worker_record_t *w,
  + int recover_wait_time,
  + jk_logger_t *l)
  +{
  +int elapsed = (int)(time(0) - w-s-error_time);
  +JK_TRACE_ENTER(l);
   
  -static int is_worker_candidate(worker_record_t *wr,
  -   int search_id,
  -   const char *search_string,
  -   jk_logger_t *l)
  -{
  -switch (search_id) {
  -case 0:
  -return JK_TRUE;
  -case 1:
  -if (strcmp(search_string, wr-s-name) == 0) {
  -return JK_TRUE;
  -}
  -break;
  -case 2:
  -if (strcmp(search_string, wr-s-name) == 0) {
  -return JK_TRUE;
  -}
  -break;
  -case 3:
  -if (strcmp(search_string, wr-s-domain) == 0) {
  -return JK_TRUE;
  -}
  -break;
  -case 4:
  -if (wr-s-is_local_worker) {
  -return JK_TRUE;
  -}
  -break;
  -case 5:
  -if (wr-s-is_local_domain) {
  -return JK_TRUE;
  -}
  -break;
  +if (elapsed = recover_wait_time) {
  +if (JK_IS_DEBUG_LEVEL(l))
  +jk_log(l, JK_LOG_DEBUG,
  +worker %s is in error state - will not yet recover (%d 
 %d),
  +w-s-name, elapsed, recover_wait_time);
   }
  -return JK_FALSE;
  +else {
  +if (JK_IS_DEBUG_LEVEL(l))
  +jk_log(l, JK_LOG_DEBUG,
  +worker %s is in error state - will recover,
  +w-s-name);
  +w-s-in_recovering  = JK_TRUE;
  +w-s-in_error_state = JK_FALSE;
  +}
  +
  +JK_TRACE_EXIT(l);
   }
   
  -static worker_record_t *get_suitable_worker(lb_worker_t *p, 
  -int search_id,
  -const char *search_string,
  -int start,
  -int stop,
  -int use_lb_factor,
  -int *domain_id,
  -jk_logger_t *l)
  +static worker_record_t *find_by_session(lb_worker_t *p, 
  +const char *name,
  +jk_logger_t *l)
   {
   
   worker_record_t *rc = NULL;
  -int lb_max = 0;
  -int total_factor = 0;
  -const char *search_type = search_types[search_id];
  -int i;
  +unsigned int i;
   
  -*domain_id = -1;
  -
  -JK_ENTER_CS((p-cs), i);
  -if (!i) {
  -jk_log(l, JK_LOG_ERROR,
  -   could not lock load balancer = %s,
  -   p-s-name);
  -return NULL;
  +for (i = 0; i  p-num_of_workers; i++) {
  +if (strcmp(p-lb_workers[i].s-name, name) == 0) {
  +rc = p-lb_workers[i];
  +break;
  +}
   }
  -if (JK_IS_DEBUG_LEVEL(l))
  -   jk_log(l, JK_LOG_DEBUG,
  -  searching for %s worker (%s),
  -  search_type, search_string);
  +return rc;
  +}
   
  -for (i = start; i  stop; i++) {
  -if (search_id  3  p-lb_workers[i].s-is_disabled) {
  +static worker_record_t *find_best_bydomain(lb_worker_t *p,
  +   const char *domain,
  +   jk_logger_t *l)

  +{

  +unsigned int i;

  +int total_factor = 0;

  +worker_record_t *candidate = NULL;

  +

  +/* First try to see if we have available candidate */

  +for (i = 0; i  p-num_of_workers; i++) {

  +/* Skip 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_status.c

2005-02-16 Thread mturk
mturk   2005/02/16 00:28:51

  Modified:jk/native/common jk_status.c
  Log:
  Display sticky session force instead local worker.
  
  Revision  ChangesPath
  1.12  +3 -3  jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_status.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_status.c   15 Feb 2005 16:23:59 -  1.11
  +++ jk_status.c   16 Feb 2005 08:28:51 -  1.12
  @@ -286,13 +286,13 @@
   int selected = -1;
   jk_puts(s, table border=\0\tr
   thType/ththSticky session/th
  -thLocal worker only/th
  +thForce Sticky session/th
   thRetries/th
   /tr\ntr);
   jk_putv(s, td, status_worker_type(w-type), /td, NULL);
   jk_putv(s, td, status_val_bool(lb-s-sticky_session),
   /td, NULL);
  -jk_putv(s, td, status_val_bool(lb-s-local_worker_only),
  +jk_putv(s, td, status_val_bool(lb-s-sticky_session_force),
   /td, NULL);
   jk_printf(s, td%d/td, lb-s-retries);
   jk_puts(s, /tr\n/table\n);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c

2005-02-16 Thread mturk
mturk   2005/02/16 00:30:58

  Modified:jk/native/common jk_lb_worker.c
  Log:
  You already know ... Remove the CRLFs. SVN, you are my last chance!
  
  Revision  ChangesPath
  1.52  +130 -130  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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- jk_lb_worker.c16 Feb 2005 08:27:52 -  1.51
  +++ jk_lb_worker.c16 Feb 2005 08:30:58 -  1.52
  @@ -207,112 +207,112 @@
   
   static worker_record_t *find_best_bydomain(lb_worker_t *p,
  const char *domain,
  -   jk_logger_t *l)

  -{

  -unsigned int i;

  -int total_factor = 0;

  -worker_record_t *candidate = NULL;

  -

  -/* First try to see if we have available candidate */

  -for (i = 0; i  p-num_of_workers; i++) {

  -/* Skip all workers that are not member of domain */

  -if (strlen(p-lb_workers[i].s-domain) == 0 ||

  -strcmp(p-lb_workers[i].s-domain, domain))

  -continue;

  -/* Take into calculation only the workers that are

  - * not in error state or not disabled.

  - */

  -if (!p-lb_workers[i].s-in_error_state 

  -!p-lb_workers[i].s-is_disabled) {

  -p-lb_workers[i].s-lb_value += p-lb_workers[i].s-lb_factor;

  -total_factor += p-lb_workers[i].s-lb_factor;

  -if (!candidate || p-lb_workers[i].s-lb_value  
candidate-s-lb_value)

  -candidate = p-lb_workers[i];

  -}

  -}

  -

  -if (candidate) {

  -candidate-s-lb_value -= total_factor;

  -}

  -

  -return candidate;

  -}

  +   jk_logger_t *l)
  +{
  +unsigned int i;
  +int total_factor = 0;
  +worker_record_t *candidate = NULL;
  +
  +/* First try to see if we have available candidate */
  +for (i = 0; i  p-num_of_workers; i++) {
  +/* Skip all workers that are not member of domain */
  +if (strlen(p-lb_workers[i].s-domain) == 0 ||
  +strcmp(p-lb_workers[i].s-domain, domain))
  +continue;
  +/* Take into calculation only the workers that are
  + * not in error state or not disabled.
  + */
  +if (!p-lb_workers[i].s-in_error_state 
  +!p-lb_workers[i].s-is_disabled) {
  +p-lb_workers[i].s-lb_value += p-lb_workers[i].s-lb_factor;
  +total_factor += p-lb_workers[i].s-lb_factor;
  +if (!candidate || p-lb_workers[i].s-lb_value  
candidate-s-lb_value)
  +candidate = p-lb_workers[i];
  +}
  +}
  +
  +if (candidate) {
  +candidate-s-lb_value -= total_factor;
  +}
  +
  +return candidate;
  +}
   
   
   static worker_record_t *find_best_byrequests(lb_worker_t *p,
  - jk_logger_t *l)

  -{

  -unsigned int i;

  -int total_factor = 0;

  -worker_record_t *candidate = NULL;

  -

  -/* First try to see if we have available candidate */

  -for (i = 0; i  p-num_of_workers; i++) {

  -/* If the worker is in error state run

  - * retry on that worker. It will be marked as

  - * operational if the retry timeout is elapsed.

  - * The worker might still be unusable, but we try

  - * anyway.

  - */

  -if (p-lb_workers[i].s-in_error_state 

  -!p-lb_workers[i].s-is_disabled) {

  -retry_worker(p-lb_workers[i], p-s-recover_wait_time, l);

  -}

  -/* Take into calculation only the workers that are

  - * not in error state or not disabled.

  - */

  -if (!p-lb_workers[i].s-in_error_state 

  -!p-lb_workers[i].s-is_disabled) {

  -p-lb_workers[i].s-lb_value += p-lb_workers[i].s-lb_factor;

  -total_factor += p-lb_workers[i].s-lb_factor;

  -if (!candidate || p-lb_workers[i].s-lb_value  
candidate-s-lb_value)

  -candidate = p-lb_workers[i];

  -}

  -}

  -

  -if (candidate) {

  -candidate-s-lb_value -= total_factor;

  -}

  -

  -return candidate;

  -}

  + jk_logger_t *l)
  +{
  +unsigned int i;
  +int total_factor = 0;
  +worker_record_t *candidate = NULL;
  +
  +/* First try to see if we have available candidate */
  +for (i = 0; i  p-num_of_workers; i++) {
  +/* If the worker is in error state run
  + * retry on that worker. It will be marked as
  + * operational if the retry timeout is elapsed.
  + * The 

JK - need some testings for new lb

2005-02-16 Thread Mladen Turk
Hi,
As said before load balancer does not have any more all
that fuzzy local_worker settings.
For most people (at least for me) that was totally unusable
and hard to understand. I hope the new settings and algo
will be more clear and much usable in conjunction with
shared memory and jk_status.
There are two major concepts:
Sessions and Domains (well, not quite new).
If there is a session that matches the worker name,
and the worker is not in error state, then this worker
will be used. OTOH if it is in error state, and the
sticky_session_force is set, then 500 will be returned.
If there is no session, and the worker is disabled, then
it will be skipped during worker election. This resolves
shutting down the node for maintenance.
If worker has the redirect parameter set, then all its
session requests will be redirected to the 'redirect'
worker. The param is meant to be used from jk_status for
redirecting nodes.
Domain is group of workers in load balancer that has
session replication in place. The jvmRoute in that case
is domain name, not the worker name. During election
phase, only the workers with same domain will be elected.
If all are in error state and the sticky_session_force is
set 500 will be returned. If not set another domain will
be elected.
I hope this resolves all use cases.
So the following directives are deprecated:
worker.xxx.local_worker
worker.xxx.local_worker_only
The following has been added:
worker.xxx.redirect (string, name of the worker or domain)
worker.xxx.sticky_session_force (boolean)
worker.xxx.domain (string, name of cluster domain/group)
Also there is a new lb directive called 'method' that
can be set to either to 0(request, default) or 1(traffic),
meaning that lb can balance depending on number of requests
or actual data transferred/read.
So, worker.lb.method=1 will balance on data transfer.
(Will not work with sticky sessions for now).
Regards,
Mladen.

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


DO NOT REPLY [Bug 33505] - mod_jk does not build on OS/400

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33505.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33505


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 10:04 ---
OK, fixed the missing semicolon.

Also, please do not reopen the case if still unbuildable.
Bugzilla is not ment to be used for development-in-progress.
It is used only for bugs in released versions.
If there are problems with current build from CVS, use dev-list instead.

Thanks,
Mladen.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 31232] - response.encodeURL() not encoding URL when mix of cookies and URL rewriting

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31232.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31232


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||WONTFIX




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 10:09 ---
I do not agree with this patch in the general case. If a cookie is submitted,
we'll use it.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33589] - stop a context without interrupting its running threads

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33589.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33589


[EMAIL PROTECTED] changed:

   What|Removed |Added

   Severity|enhancement |major
  Component|Catalina|Webapps:Manager
 OS/Version|All |Linux
   Platform|All |PC




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 10:11 ---
There are 2 sorts of stop Context :

1- When you want to stop a context because it has possibly a problem, the actual
stop context is good because you want to force the stop as quickly as possible
and you don't want to wait for anything.
2- When you to stop the context because you want to install a new WAR, I'd like
my clients don't know about it. So, I'd want a stop light (with waiting for
running threads). The service is not interrupted because, while I install my new
WAR, mod_jk balance the requests on the other(s) tomcat. And when I am ready, I
start my context and stop light the others.

The 2nd case is not resolved with a reload, because, when I install my new WAR,
(in default localhost with unpackWARs=true) my context is not the new One.
So I need a stop...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33589] - stop a context without interrupting its running threads

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33589.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33589


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 10:20 ---
Did you actually read my comment ?
- threads will have to exit your webapp while it's gone (when stopping, Tomcat
waits a little; as I've said, you can hack the code a little to wait more, or
wait forever if you want to)
- request processing will fail while your webapp is being reloaded/redeployed

If you want QoS, you need two Tomcat instances, and make use of the pause
operation on the connectors.

Judging by your latest comment, this doesn't seem it will go anywehere, so I'm
closing the bug. You are free to ask for features, and we are free to refuse to
do it ;)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c jk_util.c jk_util.h

2005-02-16 Thread mturk
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  ChangesPath
  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.c16 Feb 2005 08:30:58 -  1.52
  +++ jk_lb_worker.c16 Feb 2005 09:25:35 -  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 -  1.56
  +++ jk_util.c 16 Feb 2005 09:25:35 -  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 -  1.26
  +++ jk_util.h 16 Feb 2005 09:25:35 -  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]



[GUMP@brutus]: Project jakarta-tomcat-jk-native (in module jakarta-tomcat-connectors) failed

2005-02-16 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at [EMAIL PROTECTED]

Project jakarta-tomcat-jk-native has an issue affecting its community 
integration.
This issue affects 1 projects,
 and has been outstanding for 19 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- jakarta-tomcat-jk-native :  Connectors to various web servers


Full details are available at:

http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -INFO- Failed with reason build failed



The following work was performed:
http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/gump_work/build_jakarta-tomcat-connectors_jakarta-tomcat-jk-native.html
Work Name: build_jakarta-tomcat-connectors_jakarta-tomcat-jk-native (Type: 
Build)
Work ended in a state of : Failed
Elapsed: 
Command Line: make 
[Working Directory: 
/usr/local/gump/public/workspace/jakarta-tomcat-connectors/jk/native]
-
Making all in common
make[1]: Entering directory 
`/home/gump/workspaces2/public/workspace/jakarta-tomcat-connectors/jk/native/common'
/bin/sh 
/usr/local/gump/public/workspace/apache-httpd/dest-16022005/build/libtool 
--silent --mode=compile gcc 
-I/usr/local/gump/public/workspace/apache-httpd/dest-16022005/include -g -O2 -g 
-O2 -pthread -DHAVE_APR 
-I/usr/local/gump/public/workspace/apr/dest-16022005/include/apr-1 -g -O2 
-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE 
-I/home/gump/workspaces2/public/workspace/apache-httpd/srclib/pcre -I 
/opt/jdk1.4/include -I /opt/jdk1.4/include/ -c jk_ajp12_worker.c 
/usr/local/gump/public/workspace/apache-httpd/dest-16022005/build/libtool: 
/usr/local/gump/public/workspace/apache-httpd/dest-16022005/build/libtool: No 
such file or directory
make[1]: *** [jk_ajp12_worker.lo] Error 127
make[1]: Leaving directory 
`/home/gump/workspaces2/public/workspace/jakarta-tomcat-connectors/jk/native/common'
make: *** [all-recursive] Error 1
-

To subscribe to this information via syndicated feeds:
- RSS: 
http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/rss.xml
- Atom: 
http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/atom.xml

== Gump Tracking Only ===
Produced by Gump version 2.2.
Gump Run 2316022005, brutus:brutus-public:2316022005
Gump E-mail Identifier (unique within run) #14.

--
Apache Gump
http://gump.apache.org/ [Instance: brutus]

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



Re: JK - need some testings for new lb

2005-02-16 Thread Henri Gomez
Great :)

Build it right now and test on my Linux boxes


On Wed, 16 Feb 2005 10:01:15 +0100, Mladen Turk [EMAIL PROTECTED] wrote:
 Hi,
 
 As said before load balancer does not have any more all
 that fuzzy local_worker settings.
 For most people (at least for me) that was totally unusable
 and hard to understand. I hope the new settings and algo
 will be more clear and much usable in conjunction with
 shared memory and jk_status.
 
 There are two major concepts:
 Sessions and Domains (well, not quite new).
 
 If there is a session that matches the worker name,
 and the worker is not in error state, then this worker
 will be used. OTOH if it is in error state, and the
 sticky_session_force is set, then 500 will be returned.
 
 If there is no session, and the worker is disabled, then
 it will be skipped during worker election. This resolves
 shutting down the node for maintenance.
 
 If worker has the redirect parameter set, then all its
 session requests will be redirected to the 'redirect'
 worker. The param is meant to be used from jk_status for
 redirecting nodes.
 
 Domain is group of workers in load balancer that has
 session replication in place. The jvmRoute in that case
 is domain name, not the worker name. During election
 phase, only the workers with same domain will be elected.
 If all are in error state and the sticky_session_force is
 set 500 will be returned. If not set another domain will
 be elected.
 
 I hope this resolves all use cases.
 
 So the following directives are deprecated:
 worker.xxx.local_worker
 worker.xxx.local_worker_only
 
 The following has been added:
 worker.xxx.redirect (string, name of the worker or domain)
 worker.xxx.sticky_session_force (boolean)
 worker.xxx.domain (string, name of cluster domain/group)
 
 Also there is a new lb directive called 'method' that
 can be set to either to 0(request, default) or 1(traffic),
 meaning that lb can balance depending on number of requests
 or actual data transferred/read.
 So, worker.lb.method=1 will balance on data transfer.
 (Will not work with sticky sessions for now).
 
 Regards,
 Mladen.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 02:35:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix typo.
  
  Revision  ChangesPath
  1.80  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- jk_ajp_common.c   16 Feb 2005 08:19:46 -  1.79
  +++ jk_ajp_common.c   16 Feb 2005 10:35:46 -  1.80
  @@ -1882,7 +1882,7 @@
   /* Initialize cache slots */
   for (i = 0; i  p-ep_cache_sz; i++) {
   p-ep_cache[i] = ajp_create_endpoint(pThis, proto, now);
  -if (p-ep_cache[i]) {
  +if (!p-ep_cache[i]) {
   jk_log(l, JK_LOG_ERROR,
   Failed creating enpont cache slot %d errno=%d,
   i, errno);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_status.c

2005-02-16 Thread mturk
mturk   2005/02/16 02:52:59

  Modified:jk/native/common jk_status.c
  Log:
  Whow! We can update the worker runtime status.
  
  Revision  ChangesPath
  1.13  +128 -54   jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_status.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_status.c   16 Feb 2005 08:28:51 -  1.12
  +++ jk_status.c   16 Feb 2005 10:52:59 -  1.13
  @@ -186,7 +186,7 @@
   static const char *status_worker_type(int t)
   {
   if (t  0 || t  6)
  -t = 0;
  +t = 0;
   return worker_type[t];
   }
   
  @@ -234,6 +234,63 @@
   va_end(va);
   }
   
  +static const char *status_cmd(const char *param, const char *req, char *buf, 
size_t len)
  +{
  +char ps[32];
  +char *p;
  +size_t l = 0;
  +
  +*buf = '\0';
  +if (!req)
  +return NULL;
  +sprintf(ps, %s=, param);
  +p = strstr(req, ps);
  +if (p) {
  +p += strlen(ps);
  +while (*p) {
  +if (*p != '')
  +buf[l++] = *p;
  +else
  +break;
  +if (l + 2  len)
  +break;
  +p++;
  +}
  +buf[l] = '\0';
  +if (l)
  +return buf;
  +else
  +return NULL;
  +}
  +else
  +return NULL;
  +}
  +
  +static int status_int(const char *param, const char *req, int def)
  +{
  +const char *v;
  +char buf[32];
  +int rv = def;
  +
  +if ((v = status_cmd(param, req, buf, sizeof(buf) -1))) {
  +rv = atoi(v);
  +}
  +return rv;
  +}
  +
  +static int status_bool(const char *param, const char *req)
  +{
  +const char *v;
  +char buf[32];
  +int rv = 0;
  +
  +if ((v = status_cmd(param, req, buf, sizeof(buf {
  +if (strcasecmp(v, on) == 0 ||
  +strcasecmp(v, true) == 0)
  +rv = 1;
  +}
  +return rv;
  +}
   
   /**
* Command line reference:
  @@ -242,10 +299,10 @@
* cmd=update update configuration
* cmd=add  add new uri map.
* w=worker display detailed configuration for worker
  - * 
  + *
* Worker parameters:
* r=string redirect route name
  - * 
  + *
*/
   
   
  @@ -275,11 +332,11 @@
   jk_puts(s, hr /\nh3Worker Status for );
   if (dworker  strcmp(dworker, sw-we-worker_list[i]) == 0) {
   /* Next click will colapse the editor */
  -jk_putv(s, a href=\, s-req_uri, ?cmd=show\, NULL); 
  +jk_putv(s, a href=\, s-req_uri, ?cmd=show\, NULL);
   }
   else
   jk_putv(s, a href=\, s-req_uri, ?cmd=showw=,
  -sw-we-worker_list[i], \, NULL); 
  +sw-we-worker_list[i], \, NULL);
   jk_putv(s, sw-we-worker_list[i], /a/h3\n, NULL);
   if (lb != NULL) {
   unsigned int j;
  @@ -288,7 +345,7 @@
   thType/ththSticky session/th
   thForce Sticky session/th
   thRetries/th
  -/tr\ntr);
  +/tr\ntr);
   jk_putv(s, td, status_worker_type(w-type), /td, NULL);
   jk_putv(s, td, status_val_bool(lb-s-sticky_session),
   /td, NULL);
  @@ -346,21 +403,23 @@
   jk_putv(s, value=\, wr-s-name, \\n, NULL);
   jk_puts(s, input type=hidden name=\id\ );
   jk_printf(s, value=\%u\\n/table\n, selected);
  +jk_puts(s, input type=hidden name=\lb\ );
  +jk_printf(s, value=\%u\\n/table\n, i);
   
   jk_puts(s, table\ntrtdLoad factor:/tdtdinput 
name=\wf\ type=text );
  -jk_printf(s, value=\%d\/tdtr\n, wr-s-lb_factor);  
  
  +jk_printf(s, value=\%d\/tdtr\n, wr-s-lb_factor);
   jk_puts(s, trtdRoute Redirect:/tdtdinput 
name=\wr\ type=text );
  -jk_putv(s, value=\, wr-s-redirect, NULL); 
  +jk_putv(s, value=\, wr-s-redirect, NULL);
   jk_puts(s, \/td/tr\n);
   jk_puts(s, trtdCluster Domain:/tdtdinput 
name=\wc\ type=text );
  -jk_putv(s, value=\, wr-s-domain, NULL); 
  +jk_putv(s, value=\, wr-s-domain, NULL);
   jk_puts(s, \/td/tr\n);
   jk_puts(s, trtdDisabled:/tdtdinput name=\wd\ 
type=checkbox);
   if (wr-s-is_disabled)
   jk_puts(s,  checked);
  -jk_puts(s, /td/tr\n);
  +jk_puts(s, /td/tr\n);
   
  -jk_puts(s, trtd colspan=2nbsp;/td/tr\n);
  +jk_puts(s, trtd colspan=2nbsp;/td/tr\n);
   

Re: JK - need some testings for new lb

2005-02-16 Thread Dominik Drzewiecki
As I mentioned during 1.2.8 development phase, building jk for win32 is a 
bit more troublesome than on linux - it requires a non-free M$ VC.
Is anybody going to provide windoze binaries, please? 

regz,
/dd


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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_status.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:00:45

  Modified:jk/native/common jk_status.c
  Log:
  Whow! We can update the load balancer runtime status too.
  
  Revision  ChangesPath
  1.14  +9 -1  jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_status.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_status.c   16 Feb 2005 10:52:59 -  1.13
  +++ jk_status.c   16 Feb 2005 11:00:45 -  1.14
  @@ -498,6 +498,14 @@
   
   if (w  w-type == JK_LB_WORKER_TYPE) {
   lb = (lb_worker_t *)w-worker_private;
  +i = status_int(lr, s-query_string, lb-s-retries);
  +if (i  0)
  +lb-s-retries = i;
  +i = status_int(lt, s-query_string, lb-s-recover_wait_time);
  +if (i  59)
  +lb-s-recover_wait_time = i;
  +lb-s-sticky_session = status_bool(ls, s-query_string);
  +lb-s-sticky_session_force = status_bool(lf, s-query_string);
   }
   else  {
   int n = status_int(lb, s-query_string, -1);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:04:35

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix core dump if one of the endpoint cache entries can not
  be created by setting all pointer to zero before init.
  
  Revision  ChangesPath
  1.81  +3 -3  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- jk_ajp_common.c   16 Feb 2005 10:35:46 -  1.80
  +++ jk_ajp_common.c   16 Feb 2005 11:04:35 -  1.81
  @@ -1869,8 +1869,8 @@
   
   p-secret = jk_get_worker_secret(props, p-name);
   p-ep_mincache_sz = 1;
  -p-ep_cache = (ajp_endpoint_t **) malloc(sizeof(ajp_endpoint_t *) *
  - p-ep_cache_sz);
  +p-ep_cache = (ajp_endpoint_t **)calloc(1, sizeof(ajp_endpoint_t *) *
  +p-ep_cache_sz);
   if (p-ep_cache) {
   unsigned int i;
   time_t now = time(NULL);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:08:15

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add some loging and fix few typos. No functional change.
  
  Revision  ChangesPath
  1.82  +6 -3  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- jk_ajp_common.c   16 Feb 2005 11:04:35 -  1.81
  +++ jk_ajp_common.c   16 Feb 2005 11:08:14 -  1.82
  @@ -1884,7 +1884,7 @@
   p-ep_cache[i] = ajp_create_endpoint(pThis, proto, now);
   if (!p-ep_cache[i]) {
   jk_log(l, JK_LOG_ERROR,
  -Failed creating enpont cache slot %d errno=%d,
  +creating endpont cache slot %d errno=%d,
   i, errno);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  @@ -1892,13 +1892,16 @@
   }
   JK_INIT_CS((p-cs), i);
   if (i == JK_FALSE) {
  +jk_log(l, JK_LOG_ERROR,
  +   creating thread lock errno=%d,
  +   errno);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
   else {
   jk_log(l, JK_LOG_ERROR,
  -   Could not malloc ep_cache of size %d,
  +   allocating ep_cache of size %d,
  p-ep_cache_sz);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_status.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:24:39

  Modified:jk/native/common jk_status.c
  Log:
  Allow named status update. This will allow setting runtime data using
  any http client, not only interactive status console page.
  Full request api for updating parameters will be documented.
  
  Revision  ChangesPath
  1.15  +20 -8 jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_status.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_status.c   16 Feb 2005 11:00:45 -  1.14
  +++ jk_status.c   16 Feb 2005 11:24:39 -  1.15
  @@ -509,19 +509,31 @@
   }
   else  {
   int n = status_int(lb, s-query_string, -1);
  -worker_record_t *wr;
  +worker_record_t *wr = NULL;
   ajp_worker_t *a;
  -if (n  0 || n = (int)sw-we-num_of_workers)
  -return;
  -w = wc_get_worker_for_name(sw-we-worker_list[n], l);
  +if (n = 0  n  (int)sw-we-num_of_workers)
  +w = wc_get_worker_for_name(sw-we-worker_list[n], l);
  +else {
  +if (!(b = status_cmd(l, s-query_string, buf, sizeof(buf
  +return;
  +w = wc_get_worker_for_name(b, l);
  +}
   if (!w || w-type != JK_LB_WORKER_TYPE)
   return;
   lb = (lb_worker_t *)w-worker_private;
   i = status_int(id, s-query_string, -1);
  -if (i  0 || i = (int)lb-num_of_workers)
  +if (i = 0  i  (int)lb-num_of_workers)
  +wr = (lb-lb_workers[i]);
  +else {
  +for (i = 0; i  (int)lb-num_of_workers; i++) {
  +if (strcmp(dworker, lb-lb_workers[i].s-name) == 0) {
  +wr = (lb-lb_workers[i]);
  +break;
  +}
  +}
  +}
  +if (!wr)
   return;
  -
  -wr = (lb-lb_workers[i]);
   a  = (ajp_worker_t *)wr-w-worker_private;
   
   if ((b = status_cmd(wr, s-query_string, buf, sizeof(buf
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_msg_buff.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:42:46

  Modified:jk/native/common jk_msg_buff.c
  Log:
  Do not log trash data when dumping ajp message.
  
  Revision  ChangesPath
  1.28  +5 -3  jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.c
  
  Index: jk_msg_buff.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- jk_msg_buff.c 6 Feb 2005 09:37:59 -   1.27
  +++ jk_msg_buff.c 16 Feb 2005 11:42:46 -  1.28
  @@ -372,7 +372,8 @@
   
   for (j = 0; j  16; j++) {
   unsigned char x = (msg-buf[i + j]);
  -
  +if ((i + j) = len)
  +x = 0;
   *current++ = jk_HEX[x  4];
   *current++ = jk_HEX[x  0x0f];
   *current++ = ' ';
  @@ -382,7 +383,8 @@
   *current++ = ' ';
   for (j = 0; j  16; j++) {
   unsigned char x = msg-buf[i + j];
  -
  +if ((i + j) = len)
  +x = 0;
   if (x  0x20  x  0x7F) {
   *current++ = x;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_util.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:43:40

  Modified:jk/native/common jk_util.c
  Log:
  Use 4 digits (or more) for pid and tid. Log just looks nicer.
  
  Revision  ChangesPath
  1.58  +3 -3  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.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- jk_util.c 16 Feb 2005 09:25:35 -  1.57
  +++ jk_util.c 16 Feb 2005 11:43:39 -  1.58
  @@ -294,10 +294,10 @@
   /* Log [pid:threadid] for debug and trace levels */
   if (l-level  JK_LOG_INFO_LEVEL) {
   #ifdef USE_SPRINTF  /* until we get a snprintf function */   
 
  -used += sprintf(buf[used], [%d:%d] , getpid(),
  +used += sprintf(buf[used], [%04d:%04d] , getpid(),
   jk_gettid());
   #else
  -used += snprintf(buf[used], HUGE_BUFFER_SIZE, [%d:%d] ,
  +used += snprintf(buf[used], HUGE_BUFFER_SIZE, [%04d:%04d] ,
getpid(), jk_gettid());
   #endif
   if (used  0) {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c

2005-02-16 Thread mturk
mturk   2005/02/16 04:00:19

  Modified:jk/native/common jk_lb_worker.c
  Log:
  Add traffic method for sticky sessions too.
  
  Revision  ChangesPath
  1.54  +20 -6 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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- jk_lb_worker.c16 Feb 2005 09:25:35 -  1.53
  +++ jk_lb_worker.c16 Feb 2005 12:00:18 -  1.54
  @@ -211,6 +211,9 @@
   {
   unsigned int i;
   int total_factor = 0;
  +size_t mytraffic = 0;
  +size_t curmin = 0;
  +
   worker_record_t *candidate = NULL;
   
   /* First try to see if we have available candidate */
  @@ -224,15 +227,26 @@
*/
   if (!p-lb_workers[i].s-in_error_state 
   !p-lb_workers[i].s-is_disabled) {
  -p-lb_workers[i].s-lb_value += p-lb_workers[i].s-lb_factor;
  -total_factor += p-lb_workers[i].s-lb_factor;
  -if (!candidate || p-lb_workers[i].s-lb_value  
candidate-s-lb_value)
  -candidate = p-lb_workers[i];
  +if (p-lbmethod == JK_LB_BYREQUESTS) {
  +p-lb_workers[i].s-lb_value += 
p-lb_workers[i].s-lb_factor;
  +total_factor += p-lb_workers[i].s-lb_factor;
  +if (!candidate || p-lb_workers[i].s-lb_value  
candidate-s-lb_value)
  +candidate = p-lb_workers[i];
  +}
  +else {
  +mytraffic = 
(p-lb_workers[i].s-transferred/p-lb_workers[i].s-lb_factor) +
  +
(p-lb_workers[i].s-readed/p-lb_workers[i].s-lb_factor);
  +if (!candidate || mytraffic  curmin) {
  +candidate = p-lb_workers[i];
  +curmin = mytraffic;
  +}
  +}
   }
   }
   
   if (candidate) {
  -candidate-s-lb_value -= total_factor;
  +if (p-lbmethod == JK_LB_BYREQUESTS)
  +candidate-s-lb_value -= total_factor;
   }
   
   return candidate;
  
  
  

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



5.5.8 ?

2005-02-16 Thread Remy Maucherat
Hi Yoav,
What do you think about the idea of doing a 5.5.8 ?
The list of fixes gets longer, and there were actually two regressions 
in 5.5.7:
- JSP precompilation with taglibs in some cases
- DataSource realm connection leaking; the fix needs testing

My latest deployer changes need testing as well, as it would be good to 
avoid regressions.

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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_util.c

2005-02-16 Thread mturk
mturk   2005/02/16 04:07:28

  Modified:jk/native/common jk_util.c
  Log:
  Allow worker.lb.method to accept string methods t[raffic] or
  r[equest]. Only the first letter is checked.
  
  Revision  ChangesPath
  1.59  +11 -2 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.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- jk_util.c 16 Feb 2005 11:43:39 -  1.58
  +++ jk_util.c 16 Feb 2005 12:07:28 -  1.59
  @@ -704,12 +704,21 @@
   int jk_get_lb_method(jk_map_t *m, const char *wname)
   {
   char buf[1024];
  +const char *v;
   if (!m || !wname) {
   return DEFAULT_LB_FACTOR;
   }
   
   sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname, METHOD_OF_WORKER);
  -return jk_map_get_int(m, buf, JK_LB_BYREQUESTS);
  +v = jk_map_get_string(m, buf, NULL);
  +if (!v)
  +return JK_LB_BYREQUESTS;
  +else if  (*v == 't' || *v == 'T' || *v == '1')
  +return JK_LB_BYTRAFFIC;
  +else if  (*v == 'r' || *v == 'R' || *v == '0')
  +return JK_LB_BYREQUESTS;
  +else
  +return JK_LB_BYREQUESTS;
   }
   
   int jk_get_lb_worker_list(jk_map_t *m,
  
  
  

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



RE: 5.5.8 ?

2005-02-16 Thread Yoav Shapira
Hi,
I think 5.5.8 is a good idea, but I'd like to address the following first: 
-  6582  SERVLETAPI: Sample code does not match behavior
-  33224  when webapp config file and directory URL is specified, d...  
  (this one may already be addressed by your deployer changes)
- 33362 setclasspath.bat missing @echo off  
- 33448 wrong policy in $CATALINA_BASE/conf/catalina.policy  
- 33219 Slight code improvement  
- 32382 First App - Example App is misleading  
- 33325 add target clean to top-level build.xml  

All should be fairly easy, I don't have karma for the first, but I'll look
at the others as I have time.  If others fix them first, great ;)  

So let's maybe plan for this Saturday for 5.5.8?

Yoav

 -Original Message-
 From: Remy Maucherat [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 16, 2005 7:04 AM
 To: tomcat-dev@jakarta.apache.org
 Subject: 5.5.8 ?
 
 Hi Yoav,
 
 What do you think about the idea of doing a 5.5.8 ?
 
 The list of fixes gets longer, and there were actually two regressions
 in 5.5.7:
 - JSP precompilation with taglibs in some cases
 - DataSource realm connection leaking; the fix needs testing
 
 My latest deployer changes need testing as well, as it would be good to
 avoid regressions.
 
 Rémy
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



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



DO NOT REPLY [Bug 33605] New: - slow network peformance with ajp connector and mod_jk (1.2.8) - apache 2.052

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33605.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33605

   Summary: slow network peformance with ajp connector and mod_jk
(1.2.8) - apache 2.052
   Product: Tomcat 5
   Version: 5.5.7
  Platform: Other
OS/Version: AIX
Status: NEW
  Severity: normal
  Priority: P2
 Component: Connector:AJP
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


I compiled apache version 2.052 and tomcat connector mod_jk version 1.2.8
without any errors on AIX 5.2 ML4.
The communication between apache and tomcat via ajp13 works fine but very slow.
If I use the http connector from tomcat I can transfer a file with 10MB with 
6MB/s.
If I use the ajp13 connector via mod_jk.so then the transfer rate ist 2 KB(!)/s.
An older version of mod_jk2 was fast. Whats wrong? It seems to be a platform
problem because the same Version configuration on Windows works fast.

best regards
Torsten

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33605] - slow network peformance with ajp connector and mod_jk (1.2.8) - apache 2.052

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33605.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33605





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 13:40 ---
Hi,

Try to comment out the snd and rcv buffers in jk_connect.c
setsockopt(sock, SOL_SOCKET, SO_SNDBUF
and
setsockopt(sock, SOL_SOCKET, SO_RCVBUF

You can #if 0 the entire section for setting those two.
Tell me if that helped.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: 5.5.8 ?

2005-02-16 Thread Dominik Drzewiecki
Remy Maucherat [EMAIL PROTECTED] erote:
 Hi Yoav,
 
 What do you think about the idea of doing a 5.5.8 ?
Good idea.

 
 The list of fixes gets longer, and there were actually two regressions 
 in 5.5.7:
 - JSP precompilation with taglibs in some cases
 - DataSource realm connection leaking; the fix needs testing
I did some testing in a webapp I currently develop. And the fixed 
DataSourceRealm seems to work. No more leaking - at least the Realm returns 
all leased connections to the pool. However I observe increasing number of 
database backends after several subsequent redeployments. Since the 
datasource defined in application's context.xml serves connections to both 
DataSourceRealm as well as the application itself (Hibernate Session, to be 
exact), I suspect that there's something wrong with the DataSource cleanup 
peformed on undeployment. I'll look into it today evening. Any 
thoughts/suggestions are welcome.

regz,
/dd


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



DO NOT REPLY [Bug 33606] New: - System.err and System.out point to the same Stream

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33606.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33606

   Summary: System.err and System.out point to the same Stream
   Product: Tomcat 5
   Version: 5.5.7
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


When Tomcat starts up, both System.out and System.err are redirected to the
same PrintStream, an instance of o.a.tomcat.util.log.SystemLogHandler, which
itself wraps System.out
This happens quite early in o.a.c.startup.Catalina.load()
From then onwards no distinguish can be made between System.out.print()'s and
System.err.print()'s. The original 'System'-Error-Stream is lost.

Specifically when starting Tomcat within Eclipse (while developing/debugging a
Web-App), then the nice 'red' printed error-Stream instead of the 'blue' printed
stdout-stream is useless.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33606] - System.err and System.out point to the same Stream

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33606.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33606


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 14:45 ---
if you wish - create a listener which changes calls the appropriate
System.setXXX calls with your own stream handlers.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c

2005-02-16 Thread mturk
mturk   2005/02/16 05:46:30

  Modified:jk/native/common jk_lb_worker.c
  Log:
  If we can't get the endpoint try another worker by checking is_recoverable
  only when we got the endpoint and endpoint service has been called.
  
  Revision  ChangesPath
  1.55  +3 -3  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.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- jk_lb_worker.c16 Feb 2005 12:00:18 -  1.54
  +++ jk_lb_worker.c16 Feb 2005 13:46:30 -  1.55
  @@ -483,7 +483,6 @@
   
   if (e  e-endpoint_private  s  is_recoverable_error) {
   lb_endpoint_t *p = e-endpoint_private;
  -jk_endpoint_t *end = NULL;
   int attempt = 0;
   
   /* you can not recover on another load balancer */
  @@ -506,6 +505,7 @@
   
   if (rec) {
   int is_recoverable = JK_FALSE;
  +jk_endpoint_t *end = NULL;
   
   s-jvm_route = jk_pool_strdup(s-pool, rec-s-name);
   
  @@ -542,7 +542,7 @@
   rec-s-in_recovering = JK_FALSE;
   rec-s-error_time = time(0);
   
  -if (!is_recoverable) {
  +if (end  !is_recoverable) {
   /*
* Error is not recoverable - break with an error.
*/
  
  
  

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



DO NOT REPLY [Bug 33605] - slow network peformance with ajp connector and mod_jk (1.2.8) - apache 2.052

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33605.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33605





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 15:21 ---
Many thanks! 
The transfer rate is now fast.

But is it an AIX problem?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33159] - ant deploy task should cause a failure in target when encountering a failure

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33159.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33159





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 15:30 ---
(In reply to comment #2)
 Does it fail properly if you don't do foreach, i.e. just try a simple deploy? 
  
 I think foreach/parallel explicitly does not fail overall execution if one 
 path/list fails.

Thanks for the response Yoav. I will try and see if I can conjure up a testcase
where I can fail with a simple deploy. In the meantime, I will read up on the
foreach/parallel fail handling.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33605] - slow network peformance with ajp connector and mod_jk (1.2.8) - apache 2.052

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33605.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33605


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 15:32 ---
Yes and no.

Many OS socket implementations implements the socket buffers in
quite a strange ways ;).
So I'll probably drop that, because all that can be set at OS
level if someone needs to tune the optimal performance.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c

2005-02-16 Thread mturk
mturk   2005/02/16 07:09:21

  Modified:jk/native/apache-1.3 mod_jk.c
   jk/native/apache-2.0 mod_jk.c
   jk/native/common jk_ajp12_worker.c jk_ajp_common.c
jk_global.h jk_lb_worker.c jk_service.h
   jk/native/iis jk_isapi_plugin.c
  Log:
  Change the way how is_recoverable is handled. Instead this which
  was never used, use that value to return the specific http error code,
  namely 500 or 503.
  
  Revision  ChangesPath
  1.69  +5 -5  jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- mod_jk.c  15 Feb 2005 07:30:49 -  1.68
  +++ mod_jk.c  16 Feb 2005 15:09:20 -  1.69
  @@ -1637,6 +1637,7 @@
   struct timeval tv_begin, tv_end;
   #endif
   int rc = JK_FALSE;
  +int is_error = JK_HTTP_SERVER_ERROR;
   apache_private_data_t private_data;
   jk_ws_service_t s;
   jk_pool_atom_t buf[SMALL_POOL_SIZE];
  @@ -1661,8 +1662,7 @@
   if (init_ws_service(private_data, s, conf)) {
   jk_endpoint_t *end = NULL;
   if (worker-get_endpoint(worker, end, l)) {
  -int is_recoverable_error = JK_FALSE;
  -rc = end-service(end, s, l, is_recoverable_error);
  +rc = end-service(end, s, l, is_error);
   
   if (s.content_read  s.content_length ||
   (s.is_chunked  !s.no_more_chunks)) {
  @@ -1705,7 +1705,7 @@
   for worker=%s,
  worker_name);
   JK_TRACE_EXIT(l);
  -return HTTP_INTERNAL_SERVER_ERROR;
  +return is_error;
   }
   jk_close_pool(private_data.p);
   
  @@ -1739,7 +1739,7 @@
   for worker=%s,
  rc, worker_name);
   JK_TRACE_EXIT(l);
  -return HTTP_INTERNAL_SERVER_ERROR;
  +return is_error;
   }
   }
   else {
  
  
  
  1.126 +5 -5  jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- mod_jk.c  15 Feb 2005 07:30:49 -  1.125
  +++ mod_jk.c  16 Feb 2005 15:09:20 -  1.126
  @@ -86,8 +86,8 @@
   #define __sys_timeval_h__
   #endif
   
  -#include jk_ajp13.h
   #include jk_global.h
  +#include jk_ajp13.h
   #include jk_logger.h
   #include jk_map.h
   #include jk_pool.h
  @@ -1797,6 +1797,7 @@
   #ifndef NO_GETTIMEOFDAY
   struct timeval tv_begin, tv_end;
   #endif
  +int is_error = HTTP_INTERNAL_SERVER_ERROR;
   int rc = JK_FALSE;
   apache_private_data_t private_data;
   jk_ws_service_t s;
  @@ -1829,9 +1830,8 @@
   /* worker-get_endpoint might fail if we are out of memory 
so check */
   /* and handle it */
   if (worker-get_endpoint(worker, end, xconf-log)) {
  -int is_recoverable_error = JK_FALSE;
   rc = end-service(end, s, xconf-log,
  -  is_recoverable_error);
  +  is_error);
   
   if (s.content_read  s.content_length ||
   (s.is_chunked  !s.no_more_chunks)) {
  @@ -1915,7 +1915,7 @@
   for worker=%s,
  rc, worker_name);
   JK_TRACE_EXIT(xconf-log);
  -return HTTP_INTERNAL_SERVER_ERROR;
  +return is_error;
   }
   }
   else {
  
  
  
  1.24  +5 -5  
jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
  
  Index: jk_ajp12_worker.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jk_ajp12_worker.c 16 Feb 2005 08:15:56 -  1.23
  +++ jk_ajp12_worker.c 16 Feb 2005 15:09:20 -  1.24
  @@ -85,15 +85,15 @@
   
   static int JK_METHOD service(jk_endpoint_t *e,
jk_ws_service_t *s,
  - jk_logger_t *l, int *is_recoverable_error)
  + jk_logger_t *l, int *is_error)
   {
   jk_log(l, JK_LOG_DEBUG, Into jk_endpoint_t::service);
   
  -if (e  

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp12_worker.c

2005-02-16 Thread mturk
mturk   2005/02/16 07:22:46

  Modified:jk/native/common jk_ajp12_worker.c
  Log:
  Ajp12 protocol is not recoverable, so set the return error to 500
  in case of failrue.
  
  Revision  ChangesPath
  1.25  +6 -9  
jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
  
  Index: jk_ajp12_worker.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- jk_ajp12_worker.c 16 Feb 2005 15:09:20 -  1.24
  +++ jk_ajp12_worker.c 16 Feb 2005 15:22:46 -  1.25
  @@ -91,9 +91,11 @@
   
   if (e  e-endpoint_private  s  is_error) {
   ajp12_endpoint_t *p = e-endpoint_private;
  -unsigned attempt;
  -
  -*is_error = 0;
  +unsigned int attempt;
  +/*
  + * AJP12 protocol is not recoverable.
  + */
  +*is_error = JK_HTTP_SERVER_ERROR;
   
   for (attempt = 0; attempt  p-worker-connect_retry_attempts;
attempt++) {
  @@ -109,11 +111,6 @@
   }
   if (p-sd = 0) {
   
  -/*
  - * After we are connected, each error that we are going to
  - * have is probably unrecoverable
  - */
  -*is_error = JK_HTTP_SERVER_ERROR;
   jk_sb_open(p-sb, p-sd);
   if (ajpv12_handle_request(p, s, l)) {
   jk_log(l, JK_LOG_DEBUG,
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp12_worker.c jk_ajp_common.c jk_connect.c jk_connect.h

2005-02-16 Thread mturk
mturk   2005/02/16 07:28:28

  Modified:jk/native/common jk_ajp12_worker.c jk_ajp_common.c
jk_connect.c jk_connect.h
  Log:
  Disable Nagle algorithm by default. It was disabled anyhow, so
  just clean up the API. No functional change.
  
  Revision  ChangesPath
  1.26  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
  
  Index: jk_ajp12_worker.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- jk_ajp12_worker.c 16 Feb 2005 15:22:46 -  1.25
  +++ jk_ajp12_worker.c 16 Feb 2005 15:28:28 -  1.26
  @@ -100,7 +100,7 @@
   for (attempt = 0; attempt  p-worker-connect_retry_attempts;
attempt++) {
   p-sd =
  -jk_open_socket(p-worker-worker_inet_addr, JK_TRUE,
  +jk_open_socket(p-worker-worker_inet_addr,
  JK_FALSE, -1, l);
   
   jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::service, sd = %d,
  
  
  
  1.84  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- jk_ajp_common.c   16 Feb 2005 15:09:20 -  1.83
  +++ jk_ajp_common.c   16 Feb 2005 15:28:28 -  1.84
  @@ -835,7 +835,7 @@
   JK_TRACE_ENTER(l);
   
   for (attempt = 0; attempt  ae-worker-connect_retry_attempts; 
attempt++) {
  -ae-sd = jk_open_socket(ae-worker-worker_inet_addr, JK_TRUE,
  +ae-sd = jk_open_socket(ae-worker-worker_inet_addr,
   ae-worker-keepalive,
   ae-worker-socket_timeout, l);
   if (ae-sd = 0) {
  
  
  
  1.39  +8 -13 jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- jk_connect.c  6 Feb 2005 13:30:34 -   1.38
  +++ jk_connect.c  16 Feb 2005 15:28:28 -  1.39
  @@ -122,11 +122,12 @@
   
   /** connect to Tomcat */
   
  -int jk_open_socket(struct sockaddr_in *addr, int ndelay,
  +int jk_open_socket(struct sockaddr_in *addr,
  int keepalive, int timeout, jk_logger_t *l)
   {
   char buf[32];
   int sock;
  +int set = 1;
   
   JK_TRACE_ENTER(l);
   
  @@ -186,21 +187,15 @@
   JK_TRACE_EXIT(l);
   return -1;
   }
  -if (ndelay) {
  -int set = 1;
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG,
  -   jk_open_socket, set TCP_NODELAY to on);
  -setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)set,
  -   sizeof(set));
  -}
  +setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)set,
  +   sizeof(set));
   if (keepalive) {
  -int keep = 1;
  +set = 1;
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  jk_open_socket, set SO_KEEPALIVE to on);
  -setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (const char *)keep,
  -sizeof(keep));
  +setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (const char *)set,
  +sizeof(set));
   }
   len = 8*1024; /* Default AJP packet size */
   
  
  
  
  1.12  +2 -2  jakarta-tomcat-connectors/jk/native/common/jk_connect.h
  
  Index: jk_connect.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_connect.h  6 Feb 2005 13:30:34 -   1.11
  +++ jk_connect.h  16 Feb 2005 15:28:28 -  1.12
  @@ -37,7 +37,7 @@
   
   int jk_resolve(const char *host, int port, struct sockaddr_in *rc);
   
  -int jk_open_socket(struct sockaddr_in *addr, int ndelay,
  +int jk_open_socket(struct sockaddr_in *addr,
  int keepalive, int timeout, jk_logger_t *l);
   
   int jk_close_socket(int s);
  
  
  

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



DO NOT REPLY [Bug 31232] - response.encodeURL() not encoding URL when mix of cookies and URL rewriting

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31232.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31232





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 19:01 ---
(In reply to comment #10)
 I do not agree with this patch in the general case. If a cookie is submitted,
 we'll use it.

I agree with that with one exception. This is not a general case, it's a use
case where the (sub) context disables cookies and is expecting to use URL
rewriting. The presence of the (ROOT) cookie forces a new session on each
request since the URL rewriting is always overriden by the cookie, thus making
the (sub) context unusable.

Mixing cookies and URL rewriting is okay when the ROOT context doesn't use
cookies (ie: /subA uses cookies, and /subB uses URL rewrite). Thought it would
be easier to make the patch since this use case seems like a bug. See my comment
#3 for additional reference.

More workarounds that I thought of are:
* create a host listening on a separate port. However this port may get blocked
by firewalls since it's not port 80.
* setting up a separate domain and use URL rewriting just in that domain.
* don't use cookies at all. Not my favorite.

I just don't want other people to experience the trouble that I had.

If the decision is still a WONTFIX, then please add a note in the docs for the
cookies attribute for Context that URL rewriting won't work for sub contexts if
the ROOT context uses cookies.

thanks.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33601] - org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33601.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33601


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 19:22 ---
Bugzilla is not a support forum. Please use the tomcat-user mailing list.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 25250] - JavaBean named Component cannot be used in JSP

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=25250.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=25250


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WORKSFORME




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 20:08 ---
If you still have this problem please provide a test case (as a WAR).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 25095] - The code generated by jsp:plugin is not suitable for XHTML

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=25095.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=25095


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 OS/Version||All
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 20:24 ---
spec-quote
JSP.4.7 jsp:plugin
The plugin action enables a JSP page author to generate HTML that contains
the appropriate client browser dependent constructs (OBJECT or EMBED) that will
result in the download of the Java Plugin software (if required) and subsequent
execution of the Applet or JavaBeans component specified therein.
/spec-quote

This seems quite clear that the output is HTML, not XHTML nor does it state that
the output from this tag is dependent on any %@ page ... % directives. I
couldn't see anything in the spec that would suggest otherwise.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33572] - webapp not reload after META-INF/context.xml change

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33572.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33572





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 21:40 ---
The changing of META-INF/context.xml seems to work for me too.

I think I've noticed a side-effect since this feature is not in the 5.5.7 
release.

All of this is using Catalina/localhost/test.xml instead of
/META-INF/context.xml for the /test context.

start up tomcat, with Catalina/localhost/test.xml and /test webapp in webapps 
dir.

in 5.5.7:
1) change the test.xml
2) webapp doesn't get reloaded with new values. Nothing new here.

in the cvs head w/context reload:
1) change test.xml.
2) /test webapp dir gets deleted. In the manager, /test is listed as not running
but not undeployed
3) Try to start, but get FAIL - Application at context path /test could not be
started (obviously because the dir deleted)
4) add /test webapp back into webapps dir. start /test context with manager
5) goto #1

Again would be nice to change the values of Catalina/localhost/test.xml and
reload the webapp properly too.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33572] - webapp not reload after META-INF/context.xml change

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33572.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33572





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 22:05 ---
just want to make an additional note...

for Catalina/localhost/test.xml:
if /test is expanded from test.war in the webapps dir, then a change to test.xml
will:
1) delete /test dir
2) reload context
3) expand test.war to /test dir
4) everything is okay.

But does /test dir need to be deleted in this case?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup HostConfig.java

2005-02-16 Thread remm
remm2005/02/16 13:14:36

  Modified:catalina/src/share/org/apache/catalina/startup
HostConfig.java
  Log:
  - The XML should be added last in that case too.
  
  Revision  ChangesPath
  1.57  +4 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- HostConfig.java   15 Feb 2005 16:19:21 -  1.56
  +++ HostConfig.java   16 Feb 2005 21:14:36 -  1.57
  @@ -638,15 +638,15 @@
   
deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
   new Long(warDocBase.lastModified()));
   }
  -// Add the context XML to the list of files which 
should trigger a redeployment
  -deployedApp.redeployResources.put
  -(contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
   if (expandedDocBase.exists()) {
   
deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(),
   new 
Long(expandedDocBase.lastModified()));
   addWatchedResources(deployedApp, 
   expandedDocBase.getAbsolutePath(), 
context);
   }
  +// Add the context XML to the list of files which 
should trigger a redeployment
  +deployedApp.redeployResources.put
  +(contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
   }
   } else {
   // Add the context XML to the list of files which should 
trigger a redeployment
  
  
  

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



DO NOT REPLY [Bug 33572] - webapp not reload after META-INF/context.xml change

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33572.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33572





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 22:16 ---
Ok. So the first one is now fixed in CVS, and the second one is as expected (my
idea is that you can change things like unpackWAR on the Context element, so the
expanded folder is removed).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: 5.5.8 ?

2005-02-16 Thread Dominik Drzewiecki
Dominik Drzewiecki wrote:
The list of fixes gets longer, and there were actually two regressions 
in 5.5.7:
- JSP precompilation with taglibs in some cases
- DataSource realm connection leaking; the fix needs testing
I did some testing in a webapp I currently develop. And the fixed 
DataSourceRealm seems to work. No more leaking - at least the Realm returns 
all leased connections to the pool. However I observe increasing number of 
database backends after several subsequent redeployments. Since the 
datasource defined in application's context.xml serves connections to both 
DataSourceRealm as well as the application itself (Hibernate Session, to be 
exact), I suspect that there's something wrong with the DataSource cleanup 
peformed on undeployment. I'll look into it today evening. Any 
thoughts/suggestions are welcome.
I confirm, that the new DataSourceRealm is not a source of 
aforementioned leaked connections. The real origin of the leak was the 
fact that the Spring ContextLoaderListener couldn't properly release all 
the beans on undeploy/stop as the context parameters have been removed 
before listener's contextDestroyed() invocation. AFAIK this has also 
been fixed (bug 33463)

FYI, I tested DataSourceRealm with PostgreSQL 8.0.
regz,
/dd
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DO NOT REPLY [Bug 33572] - webapp not reload after META-INF/context.xml change

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33572.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33572





--- Additional Comments From [EMAIL PROTECTED]  2005-02-17 01:28 ---
The first is good.

As for the second (expanded WAR being deleted). It doesn't delete the expanded
dir when the conf/.../test.xml's values change...which is good.

Your last comment is a little confusing...is deleting the expanded WAR something
you wanted? in general? or just when the unpackWAR=false? From your comment I
decided to play around a bit more...

test #1:
1) start up tomcat with nothing for /test (dir, context, etc...).
2) drop /test into webapp dir. Gets deployed with default context.
3) drop test.xml into conf/.../. Still uses default context.
4) reload /test from manager. Still uses default context.
It should redeploy using test.xml when I drop it into conf/.../

The opposite is correct(?) If a deployed webapp (/test using conf/.../test.xml)
has conf/.../test.xml removed, then the webapp is redeployed using the default
context.

test #2:
I have deployed: /test using conf/.../test.xml. If I remove /test dir then
test.xml is removed too. Is that planned behaviour...a complete undeploy?

test #3:
I have deployed: test.war with expanded /test dir using conf/.../test.xml. If I
remove /test dir then test.xml is removed too. Then /test dir is recreated from
test.war using the default context. Is that planned behaviour...an undeploy
followed by complete new deploy? Changing context values redeploy with nothing
getting deleted (as noted above).

test #4:
I have deployed: test.war with expanded /test dir using conf/.../test.xml. I
change test.xml to unpackWAR=false, and it's still accessing files from /test
and not test.war. If I delete /test dir I get test #3 obviously. Changing
context values redeploy with nothing getting deleted (just still uses expanded
dir). Is that planned behaviour?

test #5:
I have deployed: test.war using conf/.../test.xml with unpackWAR=false. What
happens if I delete test.war? I have a Windoze box that doesn't allow me to
delete the war, so I can't test this but I'm assuming that test.xml is deleted
too. right? Changing context values redeploy with nothing getting deleted.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup HostConfig.java

2005-02-16 Thread remm
remm2005/02/16 16:46:14

  Modified:catalina/src/share/org/apache/catalina/startup
HostConfig.java
  Log:
  - Deleting expanded folder doesn't have too many benefits overall.
  
  Revision  ChangesPath
  1.58  +3 -3  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- HostConfig.java   16 Feb 2005 21:14:36 -  1.57
  +++ HostConfig.java   17 Feb 2005 00:46:14 -  1.58
  @@ -608,10 +608,10 @@
   // Add the eventual unpacked WAR and all the resources which 
will be
   // watched inside it
   if (isWar  unpackWARs) {
  -deployedApp.redeployResources.put
  -(contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
   
deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(),
   new Long(expandedDocBase.lastModified()));
  +deployedApp.redeployResources.put
  +(contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
   addWatchedResources(deployedApp, 
expandedDocBase.getAbsolutePath(), context);
   } else {
   if (context.getDocBase() != null) {
  
  
  

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



DO NOT REPLY [Bug 33572] - webapp not reload after META-INF/context.xml change

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33572.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33572





--- Additional Comments From [EMAIL PROTECTED]  2005-02-17 01:48 ---
If you are looking for software that reads your mind, then this is cool, but I
am not going to do it. I consider the current behavior, as fixed (the behavior
originally described in the bug report is a bug), good enough, and fairly
consistent. If you think it is perfectible, then feel free to submit patches.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_util.c jk_util.h

2005-02-16 Thread mturk
mturk   2005/02/16 23:07:51

  Modified:jk/native/common jk_util.c jk_util.h
  Log:
  Added socket_buf for optimizing socket receive and transmit buffers
  for platforms that can use them.
  
  Revision  ChangesPath
  1.60  +19 -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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- jk_util.c 16 Feb 2005 12:07:28 -  1.59
  +++ jk_util.c 17 Feb 2005 07:07:50 -  1.60
  @@ -53,6 +53,7 @@
   #define PREPOST_TIMEOUT_OF_WORKER   (prepost_timeout)
   #define REPLY_TIMEOUT_OF_WORKER (reply_timeout)
   #define SOCKET_TIMEOUT_OF_WORKER(socket_timeout)
  +#define SOCKET_BUFFER_OF_WORKER (socket_buffer)
   #define SOCKET_KEEPALIVE_OF_WORKER  (socket_keepalive)
   #define RECYCLE_TIMEOUT_OF_WORKER   (recycle_timeout)
   #define LOAD_FACTOR_OF_WORKER   (lbfactor)
  @@ -495,6 +496,23 @@
   return jk_map_get_int(m, buf, def);
   }
   
  +int jk_get_worker_socket_buffer(jk_map_t *m, const char *wname, int def)
  +{
  +char buf[1024];
  +int i;
  +if (!m || !wname) {
  +return -1;
  +}
  +
  +sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname,
  +SOCKET_BUFFER_OF_WORKER);
  +
  +i = jk_map_get_int(m, buf, 0);
  +if (i  0  i  def)
  +i = def;
  +return i;
  +}
  +
   int jk_get_worker_socket_keepalive(jk_map_t *m, const char *wname, int def)
   {
   char buf[1024];
  
  
  
  1.28  +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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- jk_util.h 16 Feb 2005 09:25:35 -  1.27
  +++ jk_util.h 17 Feb 2005 07:07:51 -  1.28
  @@ -56,6 +56,8 @@
   
   int jk_get_worker_socket_timeout(jk_map_t *m, const char *wname, int def);
   
  +int jk_get_worker_socket_buffer(jk_map_t *m, const char *wname, int def);
  +
   int jk_get_worker_socket_keepalive(jk_map_t *m, const char *wname, int def);
   
   int jk_get_worker_cache_timeout(jk_map_t *m, const char *wname, int def);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.h

2005-02-16 Thread mturk
mturk   2005/02/16 23:08:10

  Modified:jk/native/common jk_ajp_common.h
  Log:
  Added socket_buf for optimizing socket receive and transmit buffers
  for platforms that can use them.
  
  Revision  ChangesPath
  1.31  +5 -4  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jk_ajp_common.h   16 Feb 2005 08:20:59 -  1.30
  +++ jk_ajp_common.h   17 Feb 2005 07:08:09 -  1.31
  @@ -240,9 +240,9 @@
* 3. An array of open endpoints.
*/
   JK_CRIT_SEC cs;
  -unsigned ep_cache_sz;
  -unsigned ep_mincache_sz;
  -unsigned ep_maxcache_sz;
  +unsigned int ep_cache_sz;
  +unsigned int ep_mincache_sz;
  +unsigned int ep_maxcache_sz;
   ajp_endpoint_t **ep_cache;
   
   int proto;  /* PROTOCOL USED AJP13/AJP14 */
  @@ -267,6 +267,7 @@
*/
   int socket_timeout;
   int keepalive;
  +int socket_buf;
   /*
* Handle Cache Timeouts
*/
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_connect.c jk_connect.h

2005-02-16 Thread mturk
mturk   2005/02/16 23:09:27

  Modified:jk/native/common jk_connect.c jk_connect.h
  Log:
  Remove socket_timeout settings except for WIN32 platforms.
  Also add nonblocking is_connected function. Unlike cping/cpong
  this one checks the physical condition of the wire.
  
  Revision  ChangesPath
  1.40  +128 -143  jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- jk_connect.c  16 Feb 2005 15:28:28 -  1.39
  +++ jk_connect.c  17 Feb 2005 07:09:27 -  1.40
  @@ -33,6 +33,8 @@
   #include apr_network_io.h
   #include apr_errno.h
   #include apr_general.h
  +#include apr_pools.h
  +static apr_pool_t *jk_apr_pool = NULL;
   #endif
   
   #if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
  @@ -57,7 +59,7 @@
   rc-sin_family = AF_INET;
   
   /* Check if we only have digits in the string */
  -for (x = 0; '\0' != host[x]; x++) {
  +for (x = 0; host[x] != '\0'; x++) {
   if (!isdigit(host[x])  host[x] != '.') {
   break;
   }
  @@ -67,16 +69,15 @@
   if (host[x] != '\0') {
   
   #ifdef HAVE_APR
  -apr_pool_t *context;
   apr_sockaddr_t *remote_sa, *temp_sa;
   char *remote_ipaddr;
  -
  -/* May be we could avoid to recreate it each time ? */
  -if (apr_pool_create(context, NULL) != APR_SUCCESS)
  -return JK_FALSE;
  -
  +
  +if (!jk_apr_pool) {
  +if (apr_pool_create(jk_apr_pool, NULL) != APR_SUCCESS)
  +return JK_FALSE;
  +}
   if (apr_sockaddr_info_get
  -(remote_sa, host, APR_UNSPEC, (apr_port_t) port, 0, context)
  +(remote_sa, host, APR_UNSPEC, (apr_port_t) port, 0, jk_apr_pool)
   != APR_SUCCESS)
   return JK_FALSE;
   
  @@ -95,9 +96,6 @@
   apr_sockaddr_ip_get(remote_ipaddr, remote_sa);
   laddr.s_addr = inet_addr(remote_ipaddr);
   
  -/* May be we could avoid to delete it each time ? */
  -apr_pool_destroy(context);
  -
   #else /* HAVE_APR */
   
   /* XXX : WARNING : We should really use gethostbyname_r in 
multi-threaded env */
  @@ -122,114 +120,123 @@
   
   /** connect to Tomcat */
   
  -int jk_open_socket(struct sockaddr_in *addr,
  -   int keepalive, int timeout, jk_logger_t *l)
  +int jk_open_socket(struct sockaddr_in *addr, int keepalive,
  +   int timeout, int sock_buf, jk_logger_t *l)
   {
   char buf[32];
   int sock;
   int set = 1;
  +int ret;
   
   JK_TRACE_ENTER(l);
   
   sock = socket(AF_INET, SOCK_STREAM, 0);
  -if (sock = 0) {
  -int ret, len;
  -if (timeout != -1) {
  -/* do not allow non blocking sockets for now */
  -if (timeout == 0)
  -timeout = -1;
  -ret = jk_socket_timeout_set(sock, -1, timeout * 1000);
  -if (ret) {
  -jk_close_socket(sock);
  -jk_log(l, JK_LOG_ERROR,
  -   timeout_set failed with errno = %d,
  -   ret);
  -JK_TRACE_EXIT(l);
  -return -1;
  -}
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG,
  -   set timeout to %d with status %d,
  -   timeout, ret);
  -
  -}
  -
  -/* Tries to connect to Tomcat (continues trying while error is 
EINTR) */
  -do {
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG,
  -   try to connect socket = %d to %s, sock,
  -   jk_dump_hinfo(addr, buf));
  -
  -/* Need more infos for BSD 4.4 and Unix 98 defines, for now only 
  -   iSeries when Unix98 is required at compil time */
  -#if (_XOPEN_SOURCE = 520)  defined(AS400)
  -((struct sockaddr *)addr)-sa_len = sizeof(struct sockaddr_in);
  -#endif
  -ret = connect(sock,
  -  (struct sockaddr *)addr,
  -  sizeof(struct sockaddr_in));
  -#if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
  -if (SOCKET_ERROR == ret) {
  -errno = WSAGetLastError() - WSABASEERR;
  -}
  -#endif /* WIN32 */
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG,
  -   after connect ret = %d, ret);
  -} while (-1 == ret  EINTR == errno);
  -
  -/* Check if we connected */
  -if (ret == -1) {
  -jk_log(l, JK_LOG_INFO,
  -   connect() failed errno = %d, errno);
  +if (sock  0) {
 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp12_worker.c

2005-02-16 Thread mturk
mturk   2005/02/16 23:10:23

  Modified:jk/native/common jk_ajp12_worker.c
  Log:
  Use hard timeout of zero for sockets.
  
  Revision  ChangesPath
  1.27  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
  
  Index: jk_ajp12_worker.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_ajp12_worker.c 16 Feb 2005 15:28:28 -  1.26
  +++ jk_ajp12_worker.c 17 Feb 2005 07:10:23 -  1.27
  @@ -101,7 +101,7 @@
attempt++) {
   p-sd =
   jk_open_socket(p-worker-worker_inet_addr,
  -   JK_FALSE, -1, l);
  +   JK_FALSE, -1, 0, l);
   
   jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::service, sd = %d,
  p-sd);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 23:14:20

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix getting next socket from pool and add is_connected checking if
  socket_timeout is set. Also no need to reconect if is_connected or
  cping/cpong failed, because tomcat is either dead or disconnected.
  Use another worker instead, marking this one in error state.
  
  Revision  ChangesPath
  1.85  +82 -47
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- jk_ajp_common.c   16 Feb 2005 15:28:28 -  1.84
  +++ jk_ajp_common.c   17 Feb 2005 07:14:19 -  1.85
  @@ -720,24 +720,22 @@
* Try another connection from cache
*/
   
  -static void ajp_next_connection(ajp_endpoint_t **ae, jk_logger_t *l)
  +static void ajp_next_connection(ajp_endpoint_t *ae, jk_logger_t *l)
   {
   int rc;
  -ajp_worker_t *aw = (*ae)-worker;
  -
  -/* Close existing endpoint socket */
  -jk_close_socket((*ae)-sd);
  -(*ae)-sd = -1;
  +ajp_worker_t *aw = ae-worker;
   
   JK_ENTER_CS(aw-cs, rc);
   if (rc) {
   unsigned int i;
  +/* Close existing endpoint socket */
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
   for (i = 0; i  aw-ep_cache_sz; i++) {
   /* Find cache slot with usable socket */
   if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  -ajp_endpoint_t *e = aw-ep_cache[i];
  -aw-ep_cache[i] = *ae;
  -*ae = e;
  +ae-sd = aw-ep_cache[i]-sd;
  + aw-ep_cache[i]-sd = -1;
   break;
   }
   }
  @@ -837,7 +835,8 @@
   for (attempt = 0; attempt  ae-worker-connect_retry_attempts; 
attempt++) {
   ae-sd = jk_open_socket(ae-worker-worker_inet_addr,
   ae-worker-keepalive,
  -ae-worker-socket_timeout, l);
  +ae-worker-socket_timeout,
  +ae-worker-socket_buf, l);
   if (ae-sd = 0) {
   jk_log(l, JK_LOG_DEBUG,
  connected sd = %d to %s,
  @@ -845,6 +844,17 @@
   
   /* set last_access */
   ae-last_access = time(NULL);
  +if (ae-worker-socket_timeout) {
  +int rc = 0;
  +if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  +jk_log(l, JK_LOG_INFO,
  +Socket is not connected any more (status=%d), 
rc);
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
  +}
  +}
   /* Check if we must execute a logon after the physical connect */
   if (ae-worker-logon != NULL) {
   rc = ae-worker-logon(ae, l);
  @@ -1148,13 +1158,22 @@
*/
   while ((ae-sd  0)) {
   err = 0;
  -
   /* handle cping/cpong before request if timeout is set */
   if (ae-worker-prepost_timeout != 0) {
   if (ajp_handle_cping_cpong(ae, ae-worker-prepost_timeout, l) ==
   JK_FALSE)
   err++;
   }
  +else if (ae-worker-socket_timeout) {
  +int rc = 0;
  +if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  +jk_log(l, JK_LOG_INFO,
  +   Socket is not connected any more (status=%d), 
rc);
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
  +err++;
  +}
  +}
   
   /* If we got an error or can't send data, then try to get a pooled
* connection and try again.  If we are succesful, break out of this
  @@ -1163,7 +1182,7 @@
   (ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE)) {
   jk_log(l, JK_LOG_INFO,
  Error sending request. Will try another pooled 
connection);
  -ajp_next_connection(ae, l);
  +ajp_next_connection(ae, l);
   }
   else
   break;
  @@ -1173,7 +1192,14 @@
* If we failed to reuse a connection, try to reconnect.
*/
   if (ae-sd  0) {
  -
  +
  +if (err) {
  +/* XXX: If err is set, the tomcat is either dead or disconnected 
*/
  +jk_log(l, JK_LOG_INFO,
  +   All endpoints are disconnected or dead);
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
  +}
   /* no need to handle cping/cpong here since it 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c jk_lb_worker.h

2005-02-16 Thread mturk
mturk   2005/02/16 23:16:32

  Modified:jk/native/common jk_lb_worker.c jk_lb_worker.h
  Log:
  Set service route to either worker name or worker domain, depending
  on how the worker has been elected.
  
  Revision  ChangesPath
  1.57  +27 -19jakarta-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.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- jk_lb_worker.c16 Feb 2005 15:09:21 -  1.56
  +++ jk_lb_worker.c17 Feb 2005 07:16:32 -  1.57
  @@ -173,13 +173,13 @@
   if (elapsed = recover_wait_time) {
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  -worker %s is in error state - will not yet recover (%d 
 %d),
  -w-s-name, elapsed, recover_wait_time);
  +worker %s will recover in %d seconds,
  +w-s-name, recover_wait_time - elapsed);
   }
   else {
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  -worker %s is in error state - will recover,
  +worker %s is marked for recover,
   w-s-name);
   w-s-in_recovering  = JK_TRUE;
   w-s-in_error_state = JK_FALSE;
  @@ -247,6 +247,7 @@
   if (candidate) {
   if (p-lbmethod == JK_LB_BYREQUESTS)
   candidate-s-lb_value -= total_factor;
  +candidate-r = (candidate-s-domain[0]);
   }
   
   return candidate;
  @@ -286,6 +287,7 @@
   
   if (candidate) {
   candidate-s-lb_value -= total_factor;
  +candidate-r = (candidate-s-name[0]);
   }
   
   return candidate;
  @@ -337,6 +339,9 @@
   rc = find_best_byrequests(p, l);
   else if (p-lbmethod == JK_LB_BYTRAFFIC)
   rc = find_best_bytraffic(p, l);
  +/* By default use worker name as session route */
  +if (rc)
  +rc-r = (rc-s-name[0]);
   
   return rc;
   }
  @@ -485,7 +490,7 @@
   lb_endpoint_t *p = e-endpoint_private;
   int attempt = 0;
   int num_of_workers = p-worker-num_of_workers;
  -/* you can not recover on another load balancer */
  +/* Set returned error to OK */
   *is_error = JK_HTTP_OK;
   
   /* set the recovery post, for LB mode */
  @@ -505,10 +510,15 @@
   
   if (rec) {
   int is_service_error = JK_HTTP_OK;
  +int service_ok = JK_FALSE;
   jk_endpoint_t *end = NULL;
  -
  -s-jvm_route = jk_pool_strdup(s-pool, rec-s-name);
  -
  +
  +/* XXX: No need to strdup here ? */
  +#if 0
  +s-jvm_route = jk_pool_strdup(s-pool, rec-r);
  +#else
  +s-jvm_route = rec-r;
  +#endif
   rc = rec-w-get_endpoint(rec-w, end, l);
   
   if (JK_IS_DEBUG_LEVEL(l))
  @@ -517,17 +527,16 @@
  rec-s-name, s-jvm_route, rc);
   rec-s-elected++;
   if (rc  end) {
  -int src;
   /* Reset endpoint read and write sizes for
* this request.
*/
   end-rd = end-wr = 0;
  -src = end-service(end, s, l, is_service_error);
  +service_ok = end-service(end, s, l, is_service_error);
   /* Update partial reads and writes if any */
   rec-s-readed += end-rd;
   rec-s-transferred += end-wr;
   end-done(end, l);
  -if (src) {
  +if (service_ok) {
   rec-s-in_error_state = JK_FALSE;
   rec-s-in_recovering = JK_FALSE;
   rec-s-error_time = 0;
  @@ -535,7 +544,7 @@
   return JK_TRUE;
   }
   }
  -if (end) {
  +if (!service_ok) {
   /*
   * Service failed !!!
   *
  @@ -560,6 +569,9 @@
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
  +jk_log(l, JK_LOG_INFO,
  +   service failed, worker %s is in error state,
  +   rec-s-name);
   }
   else {
   /* If we can not get the endpoint from the worker
  @@ -588,8 +600,7 @@
   }
   }
   jk_log(l, JK_LOG_INFO,
  -   All tomcat instances are busy, no more endpoints left. 
  -   Rise cache_size to match the load);