cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-05-26 Thread jfclere
jfclere 2004/05/26 01:10:05

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  - adds 'debug' into setAttribute() (it was already listed in setAttributeInfo[]),
  - adds 'max_connections' to 'setAttributeInfo[]' (it was already in setAttribute()),
  - adds 'max_connections' to 'getAttributeInfo[]',
  - adds 'max_connections' to 'getAttribute()',
  - re-orders getAttributeInfo[] and  setAttributeInfo[].
  Submitted by Norm (normw at bocnet.com.au) (http://normw.gknw.com)
  
  Revision  ChangesPath
  1.65  +21 -13jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- jk_worker_ajp13.c 21 Mar 2004 09:43:09 -  1.64
  +++ jk_worker_ajp13.c 26 May 2004 08:10:05 -  1.65
  @@ -35,23 +35,26 @@
   #include jk_registry.h
   
   /*  Impl  */
  -static char *jk2_worker_ajp13_getAttributeInfo[] =
  -{ lb_factor, lb_value, debug, channel, level,
  -route, routeRedirect, errorState, graceful, groups, disabled,
  -epCount, errorTime, connectTimeout, replyTimeout,
  -prepostTimeout, NULL
  +/*
  + * Properties available to Get.
  + */
  +static char *jk2_worker_ajp13_getAttributeInfo[] = {
  +channel, groups, max_connections, epCount, level, lb_factor,
  +lb_value, route, routeRedirect,graceful, errorState, errorTime,
  +connectTimeout, replyTimeout, prepostTimeout, debug, disabled, NULL
   };
   
   static char *jk2_worker_ajp13_multiValueInfo[] = { group, NULL };
   
  -static char *jk2_worker_ajp13_setAttributeInfo[] =
  -{ debug, channel, route, routeRedirect, secretkey, group,
  -graceful,
  -disabled, lb_factor, level, connectTimeout, replyTimeout,
  -prepostTimeout, NULL
  +/*
  + * Properties available to Set.
  + */
  +static char *jk2_worker_ajp13_setAttributeInfo[] = {
  +channel, group, secretkey, max_connections, level, lb_factor,
  +route, routeRedirect, graceful, connectTimeout, replyTimeout,
  +prepostTimeout, debug, disabled, NULL
   };
   
  -
   static void *JK_METHOD jk2_worker_ajp13_getAttribute(jk_env_t *env,
jk_bean_t *bean,
char *name)
  @@ -76,6 +79,9 @@
   else if (strcmp(name, groups) == 0) {
   return jk2_map_concatKeys(env, worker-groups, :);
   }
  +else if (strcmp(name, max_connections) == 0) {
  +return jk2_env_itoa(env, worker-maxEndpoints);
  +}
   else if (strcmp(name, level) == 0) {
   return jk2_env_itoa(env, worker-level);
   }
  @@ -116,9 +122,8 @@
   }
   }
   
  -
   /*
  - * Initialize the worker
  + * Set worker properties.
*/
   static int JK_METHOD
   jk2_worker_ajp13_setAttribute(jk_env_t *env, jk_bean_t *mbean,
  @@ -168,6 +173,9 @@
   }
   else if (strcmp(name, max_connections) == 0) {
   ajp13-maxEndpoints = atoi(value);
  +}
  + else if (strcmp(name, debug) == 0) {
  +mbean-debug = atoi(value);
   }
   else {
   return JK_ERR;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-03-17 Thread hgomez
hgomez  2004/03/17 09:12:47

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Remove unused vars
  
  Revision  ChangesPath
  1.63  +0 -2  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- jk_worker_ajp13.c 12 Mar 2004 20:42:51 -  1.62
  +++ jk_worker_ajp13.c 17 Mar 2004 17:12:47 -  1.63
  @@ -231,7 +231,6 @@
   static int jk2_check_alive(jk_env_t *env, jk_endpoint_t *ae, int timeout) {
   
   int err;
  -jk_channel_t *channel=ae-worker-channel;
   jk_msg_t * msg=ae-reply;
   
   jk2_serialize_cping( env, msg, ae );
  @@ -353,7 +352,6 @@
   int err=JK_OK;
   int attempt;
   int has_post_body=JK_FALSE;
  -jk_channel_t *channel= worker-channel;
   
   e-recoverable = JK_TRUE;
   s-is_recoverable_error = JK_TRUE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-03-12 Thread truk
truk2004/03/12 12:42:51

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Don't do a prepost check alive if the endpoint is not connected yet (it
  always fails). When connecting endpoint do a prepost check alive if
  there isn't a connect check alive.
  
  Revision  ChangesPath
  1.62  +5 -2  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- jk_worker_ajp13.c 1 Mar 2004 09:35:26 -   1.61
  +++ jk_worker_ajp13.c 12 Mar 2004 20:42:51 -  1.62
  @@ -303,9 +303,12 @@
   /** XXX use a 'connected' field */
   if( ae-sd == -1 ) ae-sd=0;
   
  -if (ae-worker-connect_timeout != 0 ) {
  +if (ae-worker-connect_timeout != 0) {
   if (jk2_check_alive(env, ae, ae-worker-connect_timeout) != JK_OK)
   return JK_ERR;
  +} else if (ae-worker-prepost_timeout != 0) {
  +if (jk2_check_alive(env, ae, ae-worker-prepost_timeout) != JK_OK)
  +return JK_ERR;
   }
   
   /* Check if we must execute a logon after the physical connect */
  @@ -569,7 +572,7 @@
   s-left_bytes_to_send = s-content_length;
   s-content_read=0;
   
  -if (w-prepost_timeout != 0) {
  +if (w-prepost_timeout != 0  e-sd != -1) {
   if (jk2_check_alive(env, e, e-worker-prepost_timeout) != JK_OK)
   return JK_ERR;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-03-01 Thread hgomez
hgomez  2004/03/01 01:35:26

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Tab policies
  
  Revision  ChangesPath
  1.61  +38 -38jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- jk_worker_ajp13.c 27 Feb 2004 09:07:23 -  1.60
  +++ jk_worker_ajp13.c 1 Mar 2004 09:35:26 -   1.61
  @@ -416,55 +416,55 @@
   /* If we have the service recovery buffer FILLED and we're in first 
attempt */
   /* recopy the recovery buffer in post instead of reading it from client 
*/
   if ( s-reco_status == RECO_FILLED  (attempt==0) ) {
  - /* Get in post buf the previously saved POST */
  - 
  - if (s-reco_buf-copy(env, s-reco_buf, e-post)  0) {
  - s-is_recoverable_error = JK_FALSE;
  - env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -   ajp13.service() can't use the LB 
recovery buffer, aborting\n);
  - return JK_ERR;
  - }   
  +/* Get in post buf the previously saved POST */
  +
  +if (s-reco_buf-copy(env, s-reco_buf, e-post)  0) {
  +s-is_recoverable_error = JK_FALSE;
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp13.service() can't use the LB recovery 
buffer, aborting\n);
  +return JK_ERR;
  +}   
   
   env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.service() using the LB recovery buffer\n);
   }
   else
   {
  - if( attempt==0 )
  - err=jk2_serialize_postHead( env, e-post, s, e );
  - else
  - err=JK_OK; /* We already have the initial body chunk */
  - 
  - if( e-worker-mbean-debug  10 )
  - e-request-dump( env, e-request, Post head );
  - 
  - if (err != JK_OK ) {
  - /* the browser stop sending data, no need to recover */
  - /* e-recoverable = JK_FALSE; */
  - s-is_recoverable_error = JK_FALSE;
  - env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -   ajp13.service() Error receiving initial post %d 
%d %d\n, err, errno, attempt);
  +if( attempt==0 )
  +err=jk2_serialize_postHead( env, e-post, s, e );
  +else
  +err=JK_OK; /* We already have the initial body chunk */
  +
  +if( e-worker-mbean-debug  10 )
  +e-request-dump( env, e-request, Post head );
  +
  +if (err != JK_OK ) {
  +/* the browser stop sending data, no need to recover */
  +/* e-recoverable = JK_FALSE; */
  +s-is_recoverable_error = JK_FALSE;
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp13.service() Error receiving initial post %d 
%d %d\n, err, errno, attempt);
   
   /* BR #27281 : Should we return HTTP 500 since its the user who 
stop the sending ? */
   /* may be not, so return another HTTP code - use PARTIAL 
CONTENT, 206 instead */
   s-status = 206;
  - return JK_ERR;
  - }
  +return JK_ERR;
  +}
   
  - /* If a recovery buffer exist (LB mode), save here the 
post buf */
  - if (s-reco_status == RECO_INITED) {
  - /* Save the post for recovery if needed */
  - if (e-post-copy(env, e-post, s-reco_buf)  0) {
  - s-is_recoverable_error = JK_FALSE;
  - env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -   ajp13.service() can't save the LB 
recovery buffer, aborting\n);
  - return JK_ERR;
  - }
  - else
  - s-reco_status = RECO_FILLED;
  - }
  - }
  - 
  +/* If a recovery buffer exist (LB mode), save here the post buf */
  +if (s-reco_status == RECO_INITED) {
  +   

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-27 Thread hgomez
hgomez  2004/02/27 01:07:23

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Fix BR27281, when user stop its browser return 206 instead of 500
  
  Revision  ChangesPath
  1.60  +4 -0  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- jk_worker_ajp13.c 24 Feb 2004 08:44:40 -  1.59
  +++ jk_worker_ajp13.c 27 Feb 2004 09:07:23 -  1.60
  @@ -444,6 +444,10 @@
s-is_recoverable_error = JK_FALSE;
env-l-jkLog(env, env-l, JK_LOG_ERROR,
  ajp13.service() Error receiving initial post %d 
%d %d\n, err, errno, attempt);
  +
  +/* BR #27281 : Should we return HTTP 500 since its the user who 
stop the sending ? */
  +/* may be not, so return another HTTP code - use PARTIAL 
CONTENT, 206 instead */
  +s-status = 206;
return JK_ERR;
}
   
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-27 Thread Bill Barker

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 1:07 AM
Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/common
jk_worker_ajp13.c


 hgomez  2004/02/27 01:07:23

   Modified:jk/native2/common jk_worker_ajp13.c
   Log:
   Fix BR27281, when user stop its browser return 206 instead of 500

   Revision  ChangesPath
   1.60  +4 -0
jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c

   Index: jk_worker_ajp13.c
   ===
   RCS file:
/home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
   retrieving revision 1.59
   retrieving revision 1.60
   diff -u -r1.59 -r1.60
   --- jk_worker_ajp13.c 24 Feb 2004 08:44:40 - 1.59
   +++ jk_worker_ajp13.c 27 Feb 2004 09:07:23 - 1.60
   @@ -444,6 +444,10 @@
s-is_recoverable_error = JK_FALSE;
env-l-jkLog(env, env-l, JK_LOG_ERROR,
  ajp13.service() Error receiving initial
post %d %d %d\n, err, errno, attempt);
   +
   +/* BR #27281 : Should we return HTTP 500 since its
the user who stop the sending ? */
   +/* may be not, so return another HTTP code - use
PARTIAL CONTENT, 206 instead */
   +s-status = 206;
return JK_ERR;
}


IMHO, mod_jk2 shouldn't touch the status code in this case (since it can't
possibly be sent back to the client).  It should leave the status code as
whatever Tomcat set it to.





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



This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

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

Re: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-27 Thread Henri Gomez
Bill Barker wrote:

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 1:07 AM
Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/common
jk_worker_ajp13.c


hgomez  2004/02/27 01:07:23

 Modified:jk/native2/common jk_worker_ajp13.c
 Log:
 Fix BR27281, when user stop its browser return 206 instead of 500
 Revision  ChangesPath
 1.60  +4 -0
jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c

 Index: jk_worker_ajp13.c
 ===
 RCS file:
/home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v

 retrieving revision 1.59
 retrieving revision 1.60
 diff -u -r1.59 -r1.60
 --- jk_worker_ajp13.c 24 Feb 2004 08:44:40 - 1.59
 +++ jk_worker_ajp13.c 27 Feb 2004 09:07:23 - 1.60
 @@ -444,6 +444,10 @@
  s-is_recoverable_error = JK_FALSE;
  env-l-jkLog(env, env-l, JK_LOG_ERROR,
ajp13.service() Error receiving initial
post %d %d %d\n, err, errno, attempt);

 +
 +/* BR #27281 : Should we return HTTP 500 since its
the user who stop the sending ? */

 +/* may be not, so return another HTTP code - use
PARTIAL CONTENT, 206 instead */

 +s-status = 206;
  return JK_ERR;
  }


IMHO, mod_jk2 shouldn't touch the status code in this case (since it can't
possibly be sent back to the client).  It should leave the status code as
whatever Tomcat set it to.
The problem is that we're not sure that Tomcat send something since user
stop the upload 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-23 Thread hgomez
hgomez  2004/02/23 05:57:27

  Modified:jk/native2 CHANGES.txt
   jk/native2/include jk_worker.h
   jk/native2/common jk_worker_ajp13.c
  Log:
  Initial port of recovery_opts (from jk)
  
  Revision  ChangesPath
  1.12  +2 -2  jakarta-tomcat-connectors/jk/native2/CHANGES.txt
  
  Index: CHANGES.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/CHANGES.txt,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CHANGES.txt   16 Feb 2004 08:50:18 -  1.11
  +++ CHANGES.txt   23 Feb 2004 13:57:27 -  1.12
  @@ -10,7 +10,7 @@
   * Make use apr_port_t instead of short to fix problem to have port higher than 
32K.
   * Make default port configurable (9009 on Netware, 8009 elsewhere)
   * Fix problem when in Load-Balancing and POST [Henri Gomez].
  -
  +* Add recovery_opts (recovery strategy) which help make POST recovery 
configurable [Henri Gomez].
   Changes with JK2 2.0.4:
   * Added the load balancer stickySession property. If set to 0
 requests with servlet SESSION ID's can be routed to any Tomcat
  
  
  
  1.33  +6 -1  jakarta-tomcat-connectors/jk/native2/include/jk_worker.h
  
  Index: jk_worker.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_worker.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- jk_worker.h   16 Oct 2003 07:51:48 -  1.32
  +++ jk_worker.h   23 Feb 2004 13:57:27 -  1.33
  @@ -228,6 +228,11 @@
*/
   int reply_timeout;
   
  + /*
  +  * Recovery option
  +  */
  + int recovery_opts;  /* Set the recovery option */
  +
   /** Delay in ms for Tomcat to respond to a PING request before 
*  webserver start sending the request (ensure that Tomcat is not HOLDED)
*/
  
  
  
  1.56  +4 -0  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- jk_worker_ajp13.c 16 Feb 2004 08:34:09 -  1.55
  +++ jk_worker_ajp13.c 23 Feb 2004 13:57:27 -  1.56
  @@ -123,6 +123,8 @@
   return jk2_env_itoa( env, worker-reply_timeout);
   } else if (strcmp( name, prepostTimeout )==0 ) {
   return jk2_env_itoa( env, worker-prepost_timeout);
  +} else if (strcmp( name, recovery_opts )==0 ) {
  +return jk2_env_itoa( env, worker-recovery_opts);
   } else if (strcmp( name, disabled )==0 ) {
   return jk2_env_itoa( env, bean-disabled );
   } else if (strcmp( name, epCount )==0 ) {
  @@ -160,6 +162,8 @@
   ajp13-reply_timeout=atoi( value );
   } else if( strcmp( name, prepostTimeout )==0 ) {
   ajp13-prepost_timeout=atoi( value );
  +} else if( strcmp( name, recovery_opts )==0 ) {
  +ajp13-recovery_opts=atoi( value );
   } else if( strcmp( name, disabled )==0 ) {
   mbean-disabled=atoi( value );
   } else if( strcmp( name, group )==0 ) {
  
  
  

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



AUTO {VATTENFALL#076-817}cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-23 Thread Vattenfall Kundservice
Hej!
Tack för din e-post. Du har tilldelats ärendenummer # 76817. Vi kommer att besvara 
ditt ärende under ordinarie öppettider och återkommer med svar snarast möjligt. Vid 
fortsatta kontakter med oss ber vi dig använda svarsknappen i ditt e-postsystem. Då 
bibehålls ditt ärendenummer. Har du inte angett ditt kundnummer ber vi dig göra det i 
framtida e-post.
 
Besök gärna vår hemsida www.vattenfall.se
 
Med vänlig hälsning 
Vattenfall AB Försäljning Sverige
 
Dear customer!
Your inquiry has been assigned reference number #76817. We will return to you with a 
reply as soon as possible. In case of further contacts with Vattenfall concerning this 
inquiry please use the Reply-button in your e-mail system thus retaining the 
reference number. If you have not alreday stated your customer number please do so in 
a future e-mail.
 
Best regards 
Vattenfall AB Försäljning Sverige
 
 



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-23 Thread hgomez
hgomez  2004/02/23 09:03:43

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  More works on recoveryOpts
  
  Revision  ChangesPath
  1.58  +2 -2  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- jk_worker_ajp13.c 23 Feb 2004 15:44:26 -  1.57
  +++ jk_worker_ajp13.c 23 Feb 2004 17:03:43 -  1.58
  @@ -79,13 +79,13 @@
   static char *jk2_worker_ajp13_getAttributeInfo[]={ lb_factor, lb_value, 
debug, channel, level,
  route, routeRedirect, 
errorState, graceful, groups, disabled, 
  epCount, errorTime, 
connectTimeout, replyTimeout,
  -   prepostTimeout, NULL };
  +   prepostTimeout, 
recoveryOpts, NULL };
   
   static char *jk2_worker_ajp13_multiValueInfo[]={group, NULL };
   
   static char *jk2_worker_ajp13_setAttributeInfo[]={debug, channel, route, 
routeRedirect,secretkey, group, graceful,
 disabled, lb_factor, level, 
connectTimeout, replyTimeout,
  -   prepostTimeout, NULL };
  +   prepostTimeout, 
recoveryOpts, NULL };
   
   
   static void * JK_METHOD jk2_worker_ajp13_getAttribute(jk_env_t *env, jk_bean_t 
*bean, char *name ) {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2004-02-16 Thread hgomez
hgomez  2004/02/16 00:34:10

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Fix BR 8968 with long URI.

  

  BTW, we should handled this better since URI with more than 64 chars

  may be common...

  
  Revision  ChangesPath
  1.55  +2 -0  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- jk_worker_ajp13.c 13 Feb 2004 08:40:41 -  1.54
  +++ jk_worker_ajp13.c 16 Feb 2004 08:34:09 -  1.55
  @@ -591,6 +591,8 @@
   
   /* XXX configurable ? */
   strncpy( e-stats-active, s-req_uri, 64);
  +/* Be sure this is null terminated if it's a long url */
  +e-stats-active[63] = '\0';
   
   /* Prepare the messages we'll use.*/ 
   e-request-reset( env, e-request );
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2003-03-11 Thread costin
costin  2003/03/11 16:41:32

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Check for null - because in C you don't get NullPointerExceptions :-)
  
  Revision  ChangesPath
  1.47  +1 -1  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- jk_worker_ajp13.c 4 Mar 2003 23:59:23 -   1.46
  +++ jk_worker_ajp13.c 12 Mar 2003 00:41:32 -  1.47
  @@ -656,7 +656,7 @@
   if  (err!=JK_OK)
 return err;
   
  -if (w-channel-status) {
  +if ((w!=NULL)  (w-channel!=NULL)  (w-channel-status!=NULL)) {
   err = w-channel-status(env, w, w-channel); 
   if  (err!=JK_OK) {
   jk2_worker_ajp13_done( env, w, e);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2003-03-04 Thread costin
costin  2003/03/04 15:59:23

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  If the route is not set - default to the local name.
  
  Revision  ChangesPath
  1.46  +6 -1  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- jk_worker_ajp13.c 4 Mar 2003 07:22:10 -   1.45
  +++ jk_worker_ajp13.c 4 Mar 2003 23:59:23 -   1.46
  @@ -737,9 +737,14 @@
   if( ajp13-channel == NULL ) {
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 ajp13.init(): No channel %s\n, ajp13-mbean-localName);
  -return JK_ERR;
  +/* That's ok - it may be added later */
  +/* return JK_ERR; */
   }
   
  +if( ajp13-route==NULL ) {
  +/* Default - eventually the naming convention should become mandatory */
  +ajp13-route=bean-localName;
  +}
   
   /* Find the groups we are member on and add ourself in
*/
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2003-03-03 Thread costin
costin  2003/03/03 23:22:10

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Added setters and init for the new field
  
  Revision  ChangesPath
  1.45  +9 -7  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- jk_worker_ajp13.c 1 Mar 2003 05:49:58 -   1.44
  +++ jk_worker_ajp13.c 4 Mar 2003 07:22:10 -   1.45
  @@ -83,12 +83,12 @@
   
   /*  Impl  */
   static char *jk2_worker_ajp13_getAttributeInfo[]={ lb_factor, lb_value, 
debug, channel, level,
  -   route, errorState, 
graceful, groups,
  +   route, errorState, 
graceful, groups, disabled, 
  epCount, errorTime, NULL };
   
   static char *jk2_worker_ajp13_multiValueInfo[]={group, NULL };
   
  -static char *jk2_worker_ajp13_setAttributeInfo[]={debug, channel, route, 
secretkey, group, graceful,
  +static char *jk2_worker_ajp13_setAttributeInfo[]={debug, channel, route, 
secretkey, group, graceful, disabled, 
 lb_factor, level, NULL };
   
   
  @@ -118,7 +118,9 @@
   } else if (strcmp( name, errorState )==0 ) {
   return jk2_env_itoa( env, worker-in_error_state );
   } else if (strcmp( name, graceful )==0 ) {
  -return jk2_env_itoa( env, worker-mbean-disabled );
  +return jk2_env_itoa( env, worker-graceful );
  +} else if (strcmp( name, disabled )==0 ) {
  +return jk2_env_itoa( env, bean-disabled );
   } else if (strcmp( name, epCount )==0 ) {
   if( worker-endpointCache==NULL ) return 0;
   return jk2_env_itoa( env, worker-endpointCache-count );
  @@ -145,10 +147,9 @@
   } else if( strcmp( name, route )==0 ) {
   ajp13-route=value;
   } else if( strcmp( name, graceful )==0 ) {
  -if( strcmp( value, 0) )
  -ajp13-mbean-disabled=0;
  -else 
  -ajp13-mbean-disabled=1;
  +ajp13-graceful=atoi( value );
  +} else if( strcmp( name, disabled )==0 ) {
  +mbean-disabled=atoi( value );
   } else if( strcmp( name, group )==0 ) {
   ajp13-groups-add( env, ajp13-groups, value, ajp13 );
   } else if( strcmp( name, lb_factor )==0 ) {
  @@ -871,6 +872,7 @@
   w-secret= NULL;
   
   w-lb_factor=1;
  +w-graceful=0;
   w-service = jk2_worker_ajp13_service;
   
   result-setAttribute= jk2_worker_ajp13_setAttribute;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-11-21 Thread costin
costin  2002/11/21 09:58:35

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Same fix for jk2. Don't send initial chunk for chunked encoding.
  
  The reason the data is sent for POST - in almost all cases tomcat
  will read it ( required by the spec - to process the data ). This way
  we avoid a round-trip.
  
  We don't send more than 8k for few reasons - tomcat may want to
  discard the request ( for example to prevent a huge body that it
  can't handle ), the TCP stack would do round-trips anyway ( for flow-control )
  and most requests are 8k anyway.
  
  There is a major problem ( since the first release of Ajp13) related
  with the fact that this chunk of data is not properly
  marshalled ( it doesn't have the 'type' descriptor ).
  
  Revision  ChangesPath
  1.42  +8 -1  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- jk_worker_ajp13.c 18 Oct 2002 15:23:52 -  1.41
  +++ jk_worker_ajp13.c 21 Nov 2002 17:58:35 -  1.42
  @@ -351,7 +351,14 @@
  request was sent ( we're receiving data from client, can be slow, no
  need to delay - we can do that in paralel. ( not very sure this is
  very usefull, and it brakes the protocol ) ! */
  -if (has_post_body || s-is_chunked || s-left_bytes_to_send  0) {
  +
  + /* || s-is_chunked - this can't be done here. The original protocol sends the 
first
  +chunk of post data ( based on Content-Length ), and that's what the java 
side expects.
  +Sending this data for chunked would break other ajp13 serers.
  +
  +Note that chunking will continue to work - using the normal read.
  + */
  +if (has_post_body  || s-left_bytes_to_send  0) {
   /* We never sent any POST data and we check it we have to send at
* least of block of data (max 8k). These data will be kept in reply
* for resend if the remote Tomcat is down, a fact we will learn only
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-10-18 Thread mturk
mturk   2002/10/18 08:23:52

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Add max_connections option that checks the number of used endpoints.
  If the specified number is reached then the load balancer has the chance
  to try another worker. This is very usefull in situations when having multiple
  servers and you wish to finer grade the lb_factor.
  Perhaps the option param can have another name?
  
  Revision  ChangesPath
  1.41  +17 -0 jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- jk_worker_ajp13.c 15 Oct 2002 09:38:29 -  1.40
  +++ jk_worker_ajp13.c 18 Oct 2002 15:23:52 -  1.41
   -160,6 +160,8 
   ajp13-level=atoi( value );
   } else if( strcmp( name, channel )==0 ) {
   ajp13-channelName=value;
  +} else if( strcmp( name, max_connections )==0 ) {
  +ajp13-maxEndpoints=atoi(value);
   } else {
   return JK_ERR;
   }
   -585,6 +587,21 
   ajp13-cs-lock( env, ajp13-cs );
   
   {
  +if (ajp13-maxEndpoints  
  +ajp13-maxEndpoints = ajp13-endpointMap-size(env, 
ajp13-endpointMap)) {
  +/* The maximum number of connections is reached */
  +ajp13-in_max_epcount = JK_TRUE;
  +if( ajp13-cs != NULL ) 
  +ajp13-cs-unLock( env, ajp13-cs );
  +if( ajp13-mbean-debug  0 )
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
  +  ajp13.getEndpoint(): maximum %d endpoints for %s 
reached\n,
  +  ajp13-maxEndpoints, 
  +  ajp13-mbean-name);
  +return JK_ERR;
  +}
  +ajp13-in_max_epcount = JK_FALSE;
  +
   jkb=env-createBean2( env, ajp13-mbean-pool,  endpoint, NULL );
   if( jkb==NULL ) {
   if( ajp13-cs != NULL ) 
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-10-15 Thread mturk

mturk   2002/10/15 02:38:29

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Fix group (lb) processing for channels, allowing the lb:name syntax.
  This prevents making lb:lb:name for such situations.
  
  Revision  ChangesPath
  1.40  +30 -11jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- jk_worker_ajp13.c 4 Oct 2002 20:29:19 -   1.39
  +++ jk_worker_ajp13.c 15 Oct 2002 09:38:29 -  1.40
  @@ -740,19 +740,38 @@
   env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.init(): Adding %s to %s\n,
 ajp13-mbean-localName, name);
  -lb= env-getByName2( env, lb, name );
  -if( lb==NULL ) {
  -/* Create the lb group */
  -if( ajp13-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_DEBUG,
  -  ajp13.init(): Automatically creating the group 
%s\n,
  -  name);
  -env-createBean2( env, ajp13-workerEnv-mbean-pool, lb, name );
  +if (strncmp(name, lb:, 3) == 0) {
  +lb= env-getByName( env, name );
  +if( lb==NULL ) {
  +/* Create the lb group */
  +if( ajp13-mbean-debug  0 ) 
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
  +  ajp13.init(): Automatically creating the 
group %s\n,
  +  name);
  +env-createBean( env, ajp13-workerEnv-mbean-pool, name );
  +lb= env-getByName( env, name );
  +if( lb==NULL ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp13.init(): Failed to create %s\n, name);
  +return JK_ERR;
  +}
  +}
  +}
  +else {
   lb= env-getByName2( env, lb, name );
   if( lb==NULL ) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp13.init(): Failed to create %s\n, name);
  -return JK_ERR;
  +/* Create the lb group */
  +if( ajp13-mbean-debug  0 ) 
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
  +  ajp13.init(): Automatically creating the 
group %s\n,
  +  name);
  +env-createBean2( env, ajp13-workerEnv-mbean-pool, lb, 
name );
  +lb= env-getByName2( env, lb, name );
  +if( lb==NULL ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp13.init(): Failed to create %s\n, name);
  +return JK_ERR;
  +}
   }
   }
   lb-mbean-setAttribute(env, lb-mbean, worker,
  
  
  

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




Re: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-10-07 Thread Henri Gomez

Costin Manolache wrote:
 Mladen - time for a jk2.0.2 :-) ?
 
 I think this was a serious bug - if Nacho confirms the other tests
 are passing, we need to push it into a milestone.
 
 As a note: breaking the ajp connection on error is IMO the 
 best solution for now. If we start doing strong authentication ( i.e. the 
 ajp extensions that Henri proposed ) - then it may be expensive,
 and we should explore sending an error packet and ignoring all
 further incoming messages from tomcat. The java side should also
 check available() before sending any message. That will still avoid
 the roundtrips. 

+1 on using error packets. And we should be able to include Error 
Packets into REQUEST AND REPLIES processing, for example included
when a user hit stop when uploading/downloading datas which are
larger than 8K...

I'll take a look at it, and it should be done in a way which is
compatible with current ajp13. The idea will be to determine if
we're using an ajp13 extension level 1 (no more ajp14), which
support strong authentication and so also error packets in
post side (webserver forwarding requests data to tomcat, and
tomcat replying to webserver).





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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-10-04 Thread costin

costin  2002/10/04 13:29:19

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Tentative fix for 12346.
  
  If an unrecoverable error happens ( for example when the client
  hits stop - the server can't send more data since the connection is lost )
  we need to forcefully break the ajp13 connection, since tomcat can't
  know this and will continue to send data.
  
  This behavior is a result of the optimizations made for the 'normal' case,
  i.e. the fact that tomcat doesn't wait for confirmation when sending
  chunks of data. Adding the roundtrip will have big negative performance hit -
  and it's better to deal with the error cases.
  
  Note that the alternative ( and what seems to happen for apache ) is to
  ignore the server errors and continue to receive chunks and ignore them.
  That can save the ajp connection - with the price of having tomcat send
  useless data. For a large file that may be a bad solution, and tomcat will
  not be notified that the client had problems ( which may be a usefull info ).
  
  If this doesn't fix the problem - please send me logs with ajp debug
  enabled. I can't reproduce it ( or run IIS ), but this is clearly a bug..
  
  Revision  ChangesPath
  1.39  +7 -3  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- jk_worker_ajp13.c 8 Jul 2002 13:34:26 -   1.38
  +++ jk_worker_ajp13.c 4 Oct 2002 20:29:19 -   1.39
  @@ -398,6 +398,8 @@
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 ajp13.service() ajpGetReply unrecoverable error %d\n,
 err);
  +/* The connection is compromised, need to close it ! */
  +e-worker-in_error_state = 1;
   return JK_ERR;
   }
   
  @@ -431,7 +433,8 @@
   env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.forwardST() After %d\n,err);
   
  -
  +/* I assume no unrecoverable error can happen here - we're in a single thread,
  +   so things are simpler ( at least in this area ) */
   return err;
   }

  @@ -498,7 +501,8 @@
   }
   if (err != JK_OK){
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp13.service() Error  forwarding %s\n, e-worker-mbean-name);
  +  ajp13.service() Error  forwarding %s %d %d\n, 
e-worker-mbean-name,
  +  e-recoverable, e-worker-in_error_state);
   }
   
   if( w-mbean-debug  0 ) 
  @@ -533,7 +537,7 @@
   return JK_ERR;
   }
   
  -if( w-in_error_state ) {
  +if(  w-in_error_state ) {
   jk2_close_endpoint(env, e);
   /* if( w-mbean-debug  0 )  */
   env-l-jkLog(env, env-l, JK_LOG_INFO,
  
  
  

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




RE: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-10-04 Thread Ignacio J. Ortega

Bingo !! for me it's working now..

Need to some formal tests but seems to be working nice now.. Thanks

Saludos ,
Ignacio J. Ortega


 -Mensaje original-
 De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Enviado el: 4 de octubre de 2002 22:29
 Para: [EMAIL PROTECTED]
 Asunto: cvs commit: jakarta-tomcat-connectors/jk/native2/common
 jk_worker_ajp13.c
 
 
 costin  2002/10/04 13:29:19
 
   Modified:jk/native2/common jk_worker_ajp13.c
   Log:
   Tentative fix for 12346.
   
   If an unrecoverable error happens ( for example when the client
   hits stop - the server can't send more data since the 
 connection is lost )
   we need to forcefully break the ajp13 connection, since tomcat can't
   know this and will continue to send data.
   
   This behavior is a result of the optimizations made for the 
 'normal' case,
   i.e. the fact that tomcat doesn't wait for confirmation when sending
   chunks of data. Adding the roundtrip will have big negative 
 performance hit -
   and it's better to deal with the error cases.
   
   Note that the alternative ( and what seems to happen for 
 apache ) is to
   ignore the server errors and continue to receive chunks and 
 ignore them.
   That can save the ajp connection - with the price of having 
 tomcat send
   useless data. For a large file that may be a bad solution, 
 and tomcat will
   not be notified that the client had problems ( which may be 
 a usefull info ).
   
   If this doesn't fix the problem - please send me logs with ajp debug
   enabled. I can't reproduce it ( or run IIS ), but this is 
 clearly a bug..
   
   Revision  ChangesPath
   1.39  +7 -3  
 jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
   
   Index: jk_worker_ajp13.c
   ===
   RCS file: 
 /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worke
 r_ajp13.c,v
   retrieving revision 1.38
   retrieving revision 1.39
   diff -u -r1.38 -r1.39
   --- jk_worker_ajp13.c   8 Jul 2002 13:34:26 -   1.38
   +++ jk_worker_ajp13.c   4 Oct 2002 20:29:19 -   1.39
   @@ -398,6 +398,8 @@
env-l-jkLog(env, env-l, JK_LOG_ERROR,
  ajp13.service() ajpGetReply 
 unrecoverable error %d\n,
  err);
   +/* The connection is compromised, need to close it ! */
   +e-worker-in_error_state = 1;
return JK_ERR;
}

   @@ -431,7 +433,8 @@
env-l-jkLog(env, env-l, JK_LOG_DEBUG,
  ajp13.forwardST() After %d\n,err);

   -
   +/* I assume no unrecoverable error can happen here - 
 we're in a single thread,
   +   so things are simpler ( at least in this area ) */
return err;
}
 
   @@ -498,7 +501,8 @@
}
if (err != JK_OK){
env-l-jkLog(env, env-l, JK_LOG_ERROR,
   -  ajp13.service() Error  forwarding %s\n, 
 e-worker-mbean-name);
   +  ajp13.service() Error  forwarding %s %d 
 %d\n, e-worker-mbean-name,
   +  e-recoverable, e-worker-in_error_state);
}

if( w-mbean-debug  0 ) 
   @@ -533,7 +537,7 @@
return JK_ERR;
}

   -if( w-in_error_state ) {
   +if(  w-in_error_state ) {
jk2_close_endpoint(env, e);
/* if( w-mbean-debug  0 )  */
env-l-jkLog(env, env-l, JK_LOG_INFO,
   
   
   
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-07-08 Thread mturk

mturk   2002/07/08 06:34:26

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  no message
  
  Revision  ChangesPath
  1.38  +15 -15jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- jk_worker_ajp13.c 8 Jul 2002 00:26:07 -   1.37
  +++ jk_worker_ajp13.c 8 Jul 2002 13:34:26 -   1.38
  @@ -202,7 +202,7 @@
   static void jk2_close_endpoint(jk_env_t *env, jk_endpoint_t *ae)
   {
   if( ae-worker-mbean-debug  0 )
  -env-l-jkLog(env, env-l, JK_LOG_INFO, endpoint.close() %s\n,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG, endpoint.close() %s\n,
 ae-worker-mbean-name);
   
   /* ae-reuse = JK_FALSE; */
  @@ -236,7 +236,7 @@
   }
   
   if( ae-worker-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.connect() %s %s\n, ae-worker-channelName, 
channel-mbean-name );
   
   err=channel-open( env, channel, ae );
  @@ -324,7 +324,7 @@
   return err;
   }
   if( worker-mbean-debug  0 )
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.service() connecting to endpoint \n);
   }
   
  @@ -422,16 +422,16 @@
   int err;
   
   if( e-worker-mbean-debug  0 )
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.forwardST() Before calling native channel %s\n,
 e-worker-channel-mbean-name);
   err=e-worker-channel-send( env, e-worker-channel, e,
 e-request );
   if( e-worker-mbean-debug  0 )
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.forwardST() After %d\n,err);
   
  -
  +
   return err;
   }

  @@ -483,7 +483,7 @@
   }
   
   if( w-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.service() %s\n, w-channelName);
   
   if( w-channel-beforeRequest != NULL ) {
  @@ -502,7 +502,7 @@
   }
   
   if( w-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.service() done %s\n, e-worker-mbean-name);
   
   if( w-channel-afterRequest != NULL ) {
  @@ -547,7 +547,7 @@
   return rc;
   }
   if( w-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.done() return to pool %s\n,
 w-mbean-name );
   return JK_OK;
  @@ -603,11 +603,11 @@
   
   if( ajp13-mbean-debug  0 ) {
   if (ret==JK_OK)
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.getEndpoint(): Created endpoint %s %s \n,
 ajp13-mbean-name, jkb-name);
   else
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.getEndpoint(): endpoint creation %s %s failed\n,
 ajp13-mbean-name, jkb-name);
   }
  @@ -725,7 +725,7 @@
   lb-mbean-setAttribute(env, lb-mbean, worker,
   ajp13-mbean-name);
   if( ajp13-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.init(): Adding %s to default lb\n, 
ajp13-mbean-localName);
   } else {
   for( i=0; isize; i++ ) {
  @@ -733,14 +733,14 @@
   jk_worker_t *lb;
   
   if( ajp13-mbean-debug  0 )
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.init(): Adding %s to %s\n,
 ajp13-mbean-localName, name);
   lb= env-getByName2( env, lb, name );
   if( lb==NULL ) {
   /* Create the lb group */
   if( ajp13-mbean-debug  0 ) 
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  +env-l-jkLog(env, env-l, JK_LOG_DEBUG,
 ajp13.init(): Automatically creating the group 
%s\n,
 name);
   env-createBean2( env, 

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-06-29 Thread mturk

mturk   2002/06/29 00:49:30

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  If the channel provides the status callback call that and return
  if channel has not been initialized
  
  Revision  ChangesPath
  1.35  +8 -0  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- jk_worker_ajp13.c 26 Jun 2002 02:41:39 -  1.34
  +++ jk_worker_ajp13.c 29 Jun 2002 07:49:30 -  1.35
  @@ -626,6 +626,14 @@
   if  (err!=JK_OK)
 return err;
   
  +if (w-channel-status) {
  +err = w-channel-status(env, w-channel); 
  +if  (err!=JK_OK) {
  +jk2_worker_ajp13_done( env, w, e);
  +return err;
  +}
  +}
  +
   #ifdef HAS_APR
   if( s-uriEnv!=NULL  s-uriEnv-timing == JK_TRUE ) {
   e-stats-startTime=s-startTime;
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-06-29 Thread mturk

mturk   2002/06/29 11:29:51

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Changed the call to the service callback.
  
  Revision  ChangesPath
  1.36  +1 -2  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jk_worker_ajp13.c 29 Jun 2002 07:49:30 -  1.35
  +++ jk_worker_ajp13.c 29 Jun 2002 18:29:51 -  1.36
  @@ -627,7 +627,7 @@
 return err;
   
   if (w-channel-status) {
  -err = w-channel-status(env, w-channel); 
  +err = w-channel-status(env, w, w-channel); 
   if  (err!=JK_OK) {
   jk2_worker_ajp13_done( env, w, e);
   return err;
  @@ -840,6 +840,5 @@
   w-workerEnv=env-getByName( env, workerEnv );
   w-workerEnv-addWorker( env, w-workerEnv, w );
   
  -
   return JK_OK;
   }
  
  
  

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




RE: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-06-26 Thread GOMEZ Henri

This part of code in jk 1.2/2.0 is really a spaghetti :[

I spent many times in it, and I think we should refactor it
at least in jk2.

Certainly after aplha release.

-
Henri Gomez ___[_]
EMAIL : [EMAIL PROTECTED](. .) 
PGP KEY : 697ECEDD...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 4:42 AM
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/common
jk_worker_ajp13.c


costin  2002/06/25 19:41:39

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Another attempt to fix the 'tomcat restart' problem.
  
  send ( with either write or send() ) doesn't detect if 
tomcat is disconnected -
  only the first receive does report the error.
  
  What we do is use the 'recoverable' field to mark if tomcat 
has already
  started to process the request ( i.e. we received at least 
one packet -
  probably the HEAD, in which case the error can't be recovered ).
  
  If this is just a tomcat restart, we'll save the post body ( 
initial chunk ),
  and resend it. The logic is a bit tricky - but I think I got 
it right this
  time ( it affected the case that a POST is made just after restart )
  
  Revision  ChangesPath
  1.34  +17 -8 
jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker
_ajp13.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- jk_worker_ajp13.c20 Jun 2002 18:45:01 -  1.33
  +++ jk_worker_ajp13.c26 Jun 2002 02:41:39 -  1.34
  @@ -299,10 +299,12 @@
   {
   int err=JK_OK;
   int attempt;
  +int has_post_body=JK_FALSE;
  +jk_channel_t *channel= worker-channel;
   
   e-recoverable = JK_TRUE;
   s-is_recoverable_error = JK_TRUE;
  -
  +
   /*
* Try to send the request on a valid endpoint. If one endpoint
* fails, close the channel and try again ( maybe 
tomcat was restarted )
  @@ -311,7 +313,6 @@
* a load-balancing configuration 
*/
   for(attempt = 0 ; attempt  JK_RETRIES ;attempt++) {
  -jk_channel_t *channel= worker-channel;
   
   if( e-sd == -1 ) {
   err=jk2_worker_ajp13_connect(env, e);
  @@ -322,6 +323,9 @@
   e-worker-in_error_state=JK_TRUE;
   return err;
   }
  +if( worker-mbean-debug  0 )
  +env-l-jkLog(env, env-l, JK_LOG_INFO,
  +  ajp13.service() connecting 
to endpoint \n);
   }
   
   err=e-worker-channel-send( env, e-worker-channel, e,
  @@ -332,7 +336,6 @@
   
   if (err!=JK_OK ) {
   /* Can't send - bad endpoint, try again */
  -
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 ajp13.service() error sending, 
reconnect %s %d %d %s\n,
 e-worker-channelName, err, 
errno, strerror(errno));
  @@ -346,7 +349,7 @@
  request was sent ( we're receiving data from 
client, can be slow, no
  need to delay - we can do that in paralel. ( not 
very sure this is
  very usefull, and it brakes the protocol ) ! */
  -if (s-is_chunked || s-left_bytes_to_send  0) {
  +if (has_post_body || s-is_chunked || 
s-left_bytes_to_send  0) {
   /* We never sent any POST data and we check it 
we have to send at
* least of block of data (max 8k). These data 
will be kept in reply
* for resend if the remote Tomcat is down, a 
fact we will learn only
  @@ -354,6 +357,8 @@
*/
   if( attempt==0 )
   err=jk2_serialize_postHead( env, e-post, s, e );
  +else
  +err=JK_OK; /* We already have the initial 
body chunk */
   
   if( e-worker-mbean-debug  10 )
   e-request-dump( env, e-request, Post head );
  @@ -363,17 +368,20 @@
   /* e-recoverable = JK_FALSE; */
   s-is_recoverable_error = JK_FALSE;
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp13.service() Error 
receiving initial post \n);
  +  ajp13.service() Error 
receiving initial post %d %d %d\n, err, errno, attempt);
   return JK_ERR;
   }
  +has_post_body=JK_TRUE;
   err= e-worker-channel-send( env, 
e-worker-channel, e,
  e-post );
   if( err != JK_OK ) {
   /* e-recoverable = JK_FALSE; */
  -s-is_recoverable_error = JK_FALSE

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-06-10 Thread jfclere

jfclere 2002/06/10 00:51:06

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Typo.
  
  Revision  ChangesPath
  1.30  +1 -1  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- jk_worker_ajp13.c 9 Jun 2002 00:50:49 -   1.29
  +++ jk_worker_ajp13.c 10 Jun 2002 07:51:06 -  1.30
  @@ -72,7 +72,7 @@
   #include jk_service.h
   #include jk_env.h
   #include jk_objCache.h
  -#include jk_reqUtil.h
  +#include jk_requtil.h
   #include jk_registry.h
   
   #define AJP_DEF_RETRY_ATTEMPTS(2)
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-18 Thread nacho

nacho   02/05/18 15:43:27

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  *  Added check for a null uriEnv, IIS 2 phase process couldnt put a uriEnv in the 
service struct so was issuing a NPE
  
  Revision  ChangesPath
  1.24  +2 -2  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jk_worker_ajp13.c 16 May 2002 23:46:01 -  1.23
  +++ jk_worker_ajp13.c 18 May 2002 22:43:27 -  1.24
  @@ -621,7 +621,7 @@
   jk2_worker_ajp13_getEndpoint( env, w, e );
   
   #ifdef HAS_APR
  -if( s-uriEnv-timing == JK_TRUE ) {
  +if( s-uriEnv!=NULL  s-uriEnv-timing == JK_TRUE ) {
   e-stats-startTime=s-startTime;
   e-stats-jkStartTime=e-stats-connectedTime=apr_time_now();
   if(e-stats-startTime==0)
  @@ -641,7 +641,7 @@
   }
   
   #ifdef HAS_APR
  -if( s-uriEnv-timing == JK_TRUE ) {
  +if( s-uriEnv!=NULL  s-uriEnv-timing == JK_TRUE ) {
   apr_time_t reqTime;
   
   e-stats-endTime=apr_time_now();
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-16 Thread costin

costin  02/05/16 16:46:01

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Big cosmetic change: use ajp13 consistently.
  
  Revision  ChangesPath
  1.23  +120 -123  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_worker_ajp13.c 16 May 2002 21:03:45 -  1.22
  +++ jk_worker_ajp13.c 16 May 2002 23:46:01 -  1.23
  @@ -56,7 +56,7 @@
* = */
   
   /**
  - * Description: AJP14 next generation Bi-directional protocol.
  + * Description: AJP13 next generation Bi-directional protocol.
*  Backward compatible with Ajp13
* Author:  Henri Gomez [EMAIL PROTECTED]
* Author:  Costin [EMAIL PROTECTED]  
  @@ -75,26 +75,23 @@
   #include jk_registry.h
   
   #define AJP_DEF_RETRY_ATTEMPTS(2)
  -#define AJP14_PROTO 14
   #define AJP13_PROTO 13
   
   #define AJP13_DEF_HOST  (localhost)
   #define AJP13_DEF_PORT  (8009)
  -#define AJP14_DEF_HOST  (localhost)
  -#define AJP14_DEF_PORT  (8011)
   
   /*  Impl  */
  -static char *jk2_worker_ajp14_getAttributeInfo[]={ lb_factor, lb_value, 
  +static char *jk2_worker_ajp13_getAttributeInfo[]={ lb_factor, lb_value, 
  route, errorState, 
graceful,
  epCount, errorTime, NULL };
   
  -static char *jk2_worker_ajp14_multiValueInfo[]={group, NULL };
  +static char *jk2_worker_ajp13_multiValueInfo[]={group, NULL };
   
  -static char *jk2_worker_ajp14_setAttributeInfo[]={debug, channel, route,
  +static char *jk2_worker_ajp13_setAttributeInfo[]={debug, channel, route,
 lb_factor, level, NULL };
   
   
  -static void * JK_METHOD jk2_worker_ajp14_getAttribute(jk_env_t *env, jk_bean_t 
*bean, char *name ) {
  +static void * JK_METHOD jk2_worker_ajp13_getAttribute(jk_env_t *env, jk_bean_t 
*bean, char *name ) {
   jk_worker_t *worker=(jk_worker_t *)bean-object;
   
   if( strcmp( name, channelName )==0 ) {
  @@ -139,29 +136,29 @@
   
   
   /*
  - * Initialize the worker.
  + * Initialize the worker
*/
   static int JK_METHOD 
  -jk2_worker_ajp14_setAttribute(jk_env_t *env, jk_bean_t *mbean, 
  +jk2_worker_ajp13_setAttribute(jk_env_t *env, jk_bean_t *mbean, 
 char *name, void *valueP )
   {
  -jk_worker_t *ajp14=(jk_worker_t *)mbean-object;
  +jk_worker_t *ajp13=(jk_worker_t *)mbean-object;
   char *value=(char *)valueP;
  
   if( strcmp( name, secretkey )==0 ) {
  -ajp14-secret = value;
  +ajp13-secret = value;
   } else if( strcmp( name, tomcatId )==0 ) {
  -ajp14-route=value;
  +ajp13-route=value;
   } else if( strcmp( name, route )==0 ) {
  -ajp14-route=value;
  +ajp13-route=value;
   } else if( strcmp( name, group )==0 ) {
  -ajp14-groups-add( env, ajp14-groups, value, ajp14 );
  +ajp13-groups-add( env, ajp13-groups, value, ajp13 );
   } else if( strcmp( name, lb_factor )==0 ) {
  -ajp14-lb_factor=atoi( value );
  +ajp13-lb_factor=atoi( value );
   } else if( strcmp( name, level )==0 ) {
  -ajp14-level=atoi( value );
  +ajp13-level=atoi( value );
   } else if( strcmp( name, channel )==0 ) {
  -ajp14-channelName=value;
  +ajp13-channelName=value;
   } else {
   return JK_ERR;
   }
  @@ -223,9 +220,9 @@
   /* ae-pool-close( env, ae-pool ); */
   }
   
  -/** Connect a channel, implementing the logging protocol if ajp14
  +/** Connect a channel, implementing the logging protocol if ajp13
*/
  -static int jk2_worker_ajp14_connect(jk_env_t *env, jk_endpoint_t *ae) {
  +static int jk2_worker_ajp13_connect(jk_env_t *env, jk_endpoint_t *ae) {
   jk_channel_t *channel=ae-worker-channel;
   jk_msg_t *msg;
   
  @@ -233,19 +230,19 @@
   
   if( channel==NULL ) {
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp14.connect() no channel %s\n, ae-worker-mbean-name );
  +  ajp13.connect() no channel %s\n, ae-worker-mbean-name );
   return JK_ERR;
   }
   
   if( ae-worker-mbean-debug  0 ) 
   env-l-jkLog(env, env-l, JK_LOG_INFO,
  -  ajp14.connect() %s %s\n, ae-worker-channelName, 
channel-mbean-name );
  +  ajp13.connect() %s %s\n, ae-worker-channelName, 
channel-mbean-name );
   
   err=channel-open( env, channel, ae );
   
   if( err != JK_OK ) {
   

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-15 Thread costin

costin  02/05/15 12:41:27

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Time the requests.
  
  Revision  ChangesPath
  1.21  +56 -41jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- jk_worker_ajp13.c 14 May 2002 20:41:05 -  1.20
  +++ jk_worker_ajp13.c 15 May 2002 19:41:26 -  1.21
  @@ -74,7 +74,6 @@
   #include jk_objCache.h
   #include jk_registry.h
   
  -
   #define AJP_DEF_RETRY_ATTEMPTS(2)
   #define AJP14_PROTO 14
   #define AJP13_PROTO 13
  @@ -213,10 +212,13 @@
   env-l-jkLog(env, env-l, JK_LOG_INFO, endpoint.close() %s\n,
 ae-worker-mbean-name);
   
  -ae-reuse = JK_FALSE;
  +/* ae-reuse = JK_FALSE; */
   if( ae-worker-channel != NULL )
   ae-worker-channel-close( env, ae-worker-channel, ae );
   
  +ae-sd=-1;
  +ae-recoverable=JK_TRUE;
  +
   ae-cPool-reset( env, ae-cPool );
   /* ae-cPool-close( env, ae-cPool ); */
   
  @@ -254,7 +256,11 @@
   
   /* We just reconnected, reset error state
*/
  -ae-worker-in_error_state=0;
  +ae-worker-in_error_state=JK_FALSE;
  +
  +#ifdef HAS_APR
  +ae-stats-connectedTime=apr_time_now();
  +#endif
   
   /** XXX use a 'connected' field */
   if( ae-sd == -1 ) ae-sd=0;
  @@ -297,8 +303,8 @@
   */
   static int JK_METHOD
   jk2_worker_ajp14_sendAndReconnect(jk_env_t *env, jk_worker_t *worker,
  -  jk_ws_service_t *s,
  -  jk_endpoint_t   *e )
  +  jk_ws_service_t *s,
  +  jk_endpoint_t   *e )
   {
   int attempt;
   int err=JK_OK;
  @@ -319,10 +325,12 @@
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 ajp14.service() failed to connect endpoint errno=%d 
%s\n,
 errno, strerror( errno ));
  +
  +e-worker-in_error_state=JK_TRUE;
   return err;
   }
   }
  -/* e-request-dump(env, e-request, Before sending ); */
  +
   err=e-worker-channel-send( env, e-worker-channel, e,
 e-request );
   
  @@ -334,32 +342,12 @@
   break;
   }
   
  -if( e-recoverable != JK_TRUE ) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  - ajp14.service() error sending request %s, giving up\n,
  - worker-mbean-name);
  -return JK_ERR;
  -}
  -
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 ajp14.service() error sending, reconnect %s %d %d %s\n,
 e-worker-channelName, err, errno, strerror(errno));
   
   channel-close( env, channel, e );
  -err=jk2_worker_ajp14_connect(env, e); 
  -
  -if( err != JK_OK ) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  - ajp14.service() failed to reconnect endpoint errno=%d\n,
  - errno);
  -return JK_ERR;
  -}
  -
  -/*
  - * After we are connected, each error that we are going to
  - * have is probably unrecoverable
  - */
  -e-recoverable = JK_FALSE;
  +e-sd=-1;
   }
   return JK_OK;
   }
  @@ -372,13 +360,14 @@
   {
   int err;
   
  +e-recoverable = JK_TRUE;
  +s-is_recoverable_error = JK_TRUE;
  +
   err=jk2_worker_ajp14_sendAndReconnect( env, worker, s, e );
   if( err!=JK_OK )
   return err;
   
   /* We should have a channel now, send the post data */
  -s-is_recoverable_error = JK_TRUE;
  -e-recoverable = JK_TRUE;
   
   /* Prepare to send some post data ( ajp13 proto ). We do that after the
request was sent ( we're receiving data from client, can be slow, no
  @@ -405,6 +394,13 @@
   }
   err= e-worker-channel-send( env, e-worker-channel, e,
  e-post );
  +if( err != JK_OK ) {
  +e-recoverable = JK_FALSE;
  +s-is_recoverable_error = JK_FALSE;
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp14.service() Error receiving initial post \n);
  +return JK_ERR;
  +}
   }
   
   err = e-worker-workerEnv-processCallbacks(env, e-worker-workerEnv,
  @@ -471,13 +467,15 @@
   }
   
   e-currentRequest=s;
  +
  +/* XXX configurable ? */
  +strncpy( e-stats-active, s-req_uri, 64);
   
   /* Prepare the messages we'll use.*/ 
   e-request-reset( env, e-request );
   e-reply-reset( 

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-14 Thread costin

costin  02/05/14 10:21:09

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  - remove the stat info ( moved to endpoint )
  
  - increment the counters after the request, for each endpoint. That's very trade
  safe, as an endpoint can't be used in 2 threads.
  
  - various cosmetic changes ( removed duplicated pool, init, destroy in worker.h )
  
  - added 'introspection' info about the supported attributes and multi-value 
attributes.
  
  Revision  ChangesPath
  1.19  +43 -31jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_worker_ajp13.c 11 May 2002 00:06:58 -  1.18
  +++ jk_worker_ajp13.c 14 May 2002 17:21:09 -  1.19
  @@ -85,9 +85,15 @@
   #define AJP14_DEF_PORT  (8011)
   
   /*  Impl  */
  -static char *myAttInfo[]={ lb_factor, lb_value, reqCnt, errCnt,
  -   route, errorState, graceful,
  -   epCount, errorTime, NULL };
  +static char *jk2_worker_ajp14_getAttributeInfo[]={ lb_factor, lb_value, 
  +   route, errorState, 
graceful,
  +   epCount, errorTime, NULL };
  +
  +static char *jk2_worker_ajp14_multiValueInfo[]={group, NULL };
  +
  +static char *jk2_worker_ajp14_setAttributeInfo[]={debug, channel, route,
  +  lb_factor, level, NULL };
  +
   
   static void * JK_METHOD jk2_worker_ajp14_getAttribute(jk_env_t *env, jk_bean_t 
*bean, char *name ) {
   jk_worker_t *worker=(jk_worker_t *)bean-object;
  @@ -107,14 +113,6 @@
   char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
   sprintf( buf, %d, worker-lb_value );
   return buf;
  -} else if (strcmp( name, reqCnt )==0 ) {
  -char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
  -sprintf( buf, %d, worker-reqCnt );
  -return buf;
  -} else if (strcmp( name, errCnt )==0 ) {
  -char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
  -sprintf( buf, %d, worker-errCnt );
  -return buf;
   } else if (strcmp( name, lb_factor )==0 ) {
   char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
   sprintf( buf, %d, worker-lb_factor );
  @@ -140,10 +138,6 @@
   }
   }
   
  -static char *jk2_worker_ajp_multiValueInfo[]={group, NULL };
  -
  -static char *jk2_worker_ajp_setAttributeInfo[]={debug, channel, tomcatId, 
lb_factor, NULL };
  -
   
   /*
* Initialize the worker.
  @@ -164,10 +158,14 @@
   ajp14-secret = value;
   } else if( strcmp( name, tomcatId )==0 ) {
   ajp14-route=value;
  +} else if( strcmp( name, route )==0 ) {
  +ajp14-route=value;
   } else if( strcmp( name, group )==0 ) {
   ajp14-groups-add( env, ajp14-groups, value, ajp14 );
   } else if( strcmp( name, lb_factor )==0 ) {
   ajp14-lb_factor=atoi( value );
  +} else if( strcmp( name, level )==0 ) {
  +ajp14-level=atoi( value );
   } else if( strcmp( name, channel )==0 ) {
   ajp14-channelName=value;
   } else {
  @@ -327,7 +325,10 @@
   /* e-request-dump(env, e-request, Before sending ); */
   err=e-worker-channel-send( env, e-worker-channel, e,
 e-request );
  -e-request-dump( env, e-request, Sent );
  +
  +if( e-worker-mbean-debug  10 )
  +e-request-dump( env, e-request, Sent );
  +
   if (err==JK_OK ) {
   /* We sent the request, have valid endpoint */
   break;
  @@ -391,6 +392,9 @@
 */
   err=jk2_serialize_postHead( env, e-post, s, e );
   
  +if( e-worker-mbean-debug  10 )
  +e-request-dump( env, e-request, Post head );
  +
   if (err != JK_OK ) {
   /* the browser stop sending data, no need to recover */
   e-recoverable = JK_FALSE;
  @@ -473,7 +477,6 @@
   e-reply-reset( env, e-reply );
   e-post-reset( env, e-post );
   
  -e-uploadfd   = -1;  /* not yet used, later ;) */
   e-reuse = JK_FALSE;
   s-is_recoverable_error = JK_TRUE;
   /* Up to now, we can recover */
  @@ -584,7 +587,7 @@
   return JK_OK;
   }
   
  -jkb=env-createBean2( env,ajp14-pool,  endpoint, NULL );
  +jkb=env-createBean2( env, ajp14-mbean-pool,  endpoint, NULL );
   if( jkb==NULL )
   return JK_ERR;
   if( ajp14-mbean-debug  0 )
  @@ -618,27 +621,36 @@
   if( err!=JK_OK ) {
   w-in_error_state=JK_TRUE;
   }
  +
  +if( err==JK_OK ) {
  +e-stats-reqCnt++;
  +} else {
  + 

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-14 Thread costin

costin  02/05/14 13:41:05

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Better management of endpoints for a worker.
  
  Revision  ChangesPath
  1.20  +34 -10jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_worker_ajp13.c 14 May 2002 17:21:09 -  1.19
  +++ jk_worker_ajp13.c 14 May 2002 20:41:05 -  1.20
  @@ -571,6 +571,7 @@
   jk_endpoint_t *e = NULL;
   jk_pool_t *endpointPool;
   jk_bean_t *jkb;
  +int csOk;
   
   if( ajp14-secret ==NULL ) {
   }
  @@ -587,19 +588,35 @@
   return JK_OK;
   }
   
  -jkb=env-createBean2( env, ajp14-mbean-pool,  endpoint, NULL );
  -if( jkb==NULL )
  -return JK_ERR;
  +JK_ENTER_CS(ajp14-cs, csOk);
  +if( !csOk ) return JK_ERR;
  +
  +{
  +char *epName=ajp14-mbean-pool-calloc( env, ajp14-mbean-pool, 20);
  +
  +sprintf( epName, %d, ajp14-endpointMap-size( env, ajp14-endpointMap ));
  +
  +jkb=env-createBean2( env, ajp14-mbean-pool,  endpoint, epName );
  +if( jkb==NULL ) {
  +JK_LEAVE_CS( ajp14-cs, csOk );
  +return JK_ERR;
  +}
  +
  +e = (jk_endpoint_t *)jkb-object;
  +e-worker = ajp14;
  +e-sd=-1;
  +
  +ajp14-endpointMap-add( env, ajp14-endpointMap, epName, jkb );
  + 
  +*eP = e;
  +}
  +JK_LEAVE_CS( ajp14-cs, csOk );
  +
   if( ajp14-mbean-debug  0 )
   env-l-jkLog(env, env-l, JK_LOG_INFO,
  -  ajp14.getEndpoint(): Creating endpoint %s %s \n,
  +  ajp14.getEndpoint(): Created endpoint %s %s \n,
 ajp14-mbean-name, jkb-name);
   
  -e = (jk_endpoint_t *)jkb-object;
  -e-worker = ajp14;
  -e-sd=-1;
  -
  -*eP = e;
   return JK_OK;
   }
   
  @@ -762,16 +779,23 @@
   const char *type, const char *name)
   {
   jk_worker_t *w=(jk_worker_t *)pool-calloc(env, pool, sizeof(jk_worker_t));
  +int i;
   
   if (name == NULL || w == NULL) {
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 ajp14.factory() NullPointerException\n);
   return JK_ERR;
   }
  -w-cache_sz=-1;
   
   jk2_map_default_create(env, w-groups, pool);
  +jk2_map_default_create(env, w-endpointMap, pool);
   
  +JK_INIT_CS((w-cs), i);
  +if (i!=JK_TRUE) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  objCache.create(): Can't init CS\n);
  +}
  +
   w-endpointCache= NULL;
   
   w-channel= NULL;
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-10 Thread costin

costin  02/05/10 17:06:58

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Few ( bigger ) changes:
  
  - we no longer de-allocate the endpoint. The ep will store important statistics
  about request processing ( times, nr. of requests, etc ) - it's much better
  than the worker since an endpoint is active in a single thread, so we
  don't need atomic or syncs.
  
  - also check if we are connected ( right now we use sd, if it's 0 we
  assume it's not connected - we set it to -1 when we create the endpoint
  and after close, and set it to 0 if the channel doesn't do it - I could
  add a separate flag but I'm lazy today ).
  
  - few small fixes to make sure the endpoints are doing well.
  
  Revision  ChangesPath
  1.18  +75 -55jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_worker_ajp13.c 9 May 2002 23:47:31 -   1.17
  +++ jk_worker_ajp13.c 11 May 2002 00:06:58 -  1.18
  @@ -166,8 +166,6 @@
   ajp14-route=value;
   } else if( strcmp( name, group )==0 ) {
   ajp14-groups-add( env, ajp14-groups, value, ajp14 );
  -} else if( strcmp( name, cachesize )==0 ) {
  -ajp14-cache_sz=atoi( value );
   } else if( strcmp( name, lb_factor )==0 ) {
   ajp14-lb_factor=atoi( value );
   } else if( strcmp( name, channel )==0 ) {
  @@ -220,10 +218,14 @@
   ae-reuse = JK_FALSE;
   if( ae-worker-channel != NULL )
   ae-worker-channel-close( env, ae-worker-channel, ae );
  +
   ae-cPool-reset( env, ae-cPool );
  -ae-cPool-close( env, ae-cPool );
  -ae-pool-reset( env, ae-pool );
  -ae-pool-close( env, ae-pool );
  +/* ae-cPool-close( env, ae-cPool ); */
  +
  +/* Don't touch the ae-pool, the object has important
  +   statistics */
  +/* ae-pool-reset( env, ae-pool ); */
  +/* ae-pool-close( env, ae-pool ); */
   }
   
   /** Connect a channel, implementing the logging protocol if ajp14
  @@ -252,6 +254,13 @@
   return JK_ERR;
   }
   
  +/* We just reconnected, reset error state
  + */
  +ae-worker-in_error_state=0;
  +
  +/** XXX use a 'connected' field */
  +if( ae-sd == -1 ) ae-sd=0;
  +
   /* Check if we must execute a logon after the physical connect */
   if (ae-worker-secret == NULL)
   return JK_OK;
  @@ -294,7 +303,7 @@
 jk_endpoint_t   *e )
   {
   int attempt;
  -int err;
  +int err=JK_OK;
   
   /*
* Try to send the request on a valid endpoint. If one endpoint
  @@ -306,11 +315,20 @@
   for(attempt = 0 ; attempt  JK_RETRIES ;attempt++) {
   jk_channel_t *channel= worker-channel;
   
  +if( e-sd == -1 ) {
  +err=jk2_worker_ajp14_connect(env, e);
  +if( err!=JK_OK ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp14.service() failed to connect endpoint errno=%d 
%s\n,
  +  errno, strerror( errno ));
  +return err;
  +}
  +}
   /* e-request-dump(env, e-request, Before sending ); */
   err=e-worker-channel-send( env, e-worker-channel, e,
 e-request );
  -
  - if (err==JK_OK ) {
  +e-request-dump( env, e-request, Sent );
  +if (err==JK_OK ) {
   /* We sent the request, have valid endpoint */
   break;
   }
  @@ -323,11 +341,10 @@
   }
   
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -ajp14.service() error sending, reconnect %s %s\n,
  -  e-worker-mbean-name, e-worker-channelName);
  +  ajp14.service() error sending, reconnect %s %d %d %s\n,
  +  e-worker-channelName, err, errno, strerror(errno));
   
   channel-close( env, channel, e );
  -
   err=jk2_worker_ajp14_connect(env, e); 
   
   if( err != JK_OK ) {
  @@ -386,10 +403,6 @@
  e-post );
   }
   
  -if( e-worker-mbean-debug  0 )
  -env-l-jkLog(env, env-l, JK_LOG_INFO,
  -  ajp14.service() processing callbacks %s\n, 
e-worker-channel-mbean-name);
  -
   err = e-worker-workerEnv-processCallbacks(env, e-worker-workerEnv,
e, s);
   
  @@ -515,31 +528,35 @@
   jk2_worker_ajp14_done(jk_env_t *env, jk_worker_t *we, jk_endpoint_t *e)
   {
   jk_worker_t *w;
  +int rc=JK_OK;
   
   w= e-worker;
   
   if( e-cPool != NULL ) 
   e-cPool-reset(env, e-cPool);
  -if (! 

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-05-03 Thread costin

costin  02/05/03 10:47:31

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Update the list of properties to include more lb info.
  
  Automatically add the worker to all the groups that are configured in.
  
  The load balancing is now configured by including (one or many)
  group attributes on the channel. Each group name will be used
  to construct automatically an lb worker, and the channel will be
  added to the lb worker.
  
  The name of the group can then be used in uri mappings.
  
  Revision  ChangesPath
  1.12  +73 -60jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_worker_ajp13.c 1 May 2002 23:10:17 -   1.11
  +++ jk_worker_ajp13.c 3 May 2002 17:47:31 -   1.12
  @@ -85,7 +85,8 @@
   #define AJP14_DEF_PORT  (8011)
   
   /*  Impl  */
  -static char *myAttInfo[]={ channelName, route, errorState, recovering,
  +static char *myAttInfo[]={ lb_factor, lb_value, reqCnt, errCnt,
  +   route, errorState, recovering,
  epCount, NULL };
   
   static void * JK_METHOD jk2_worker_ajp14_getAttribute(jk_env_t *env, jk_bean_t 
*bean, char *name ) {
  @@ -98,6 +99,22 @@
   return worker-channelName;
   } else if (strcmp( name, route )==0 ) {
   return worker-route;
  +} else if (strcmp( name, lb_value )==0 ) {
  +char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
  +sprintf( buf, %f, worker-lb_value );
  +return buf;
  +} else if (strcmp( name, reqCnt )==0 ) {
  +char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
  +sprintf( buf, %d, worker-reqCnt );
  +return buf;
  +} else if (strcmp( name, errCnt )==0 ) {
  +char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
  +sprintf( buf, %d, worker-errCnt );
  +return buf;
  +} else if (strcmp( name, lb_factor )==0 ) {
  +char *buf=env-tmpPool-calloc( env, env-tmpPool, 20 );
  +sprintf( buf, %f, worker-lb_factor );
  +return buf;
   } else if (strcmp( name, errorState )==0 ) {
   if( worker-in_error_state ) 
   return Y;
  @@ -136,6 +153,10 @@
  
   if( strcmp( name, secretkey )==0 ) {
   ajp14-secret = value;
  +} else if( strcmp( name, tomcatId )==0 ) {
  +ajp14-route=value;
  +} else if( strcmp( name, group )==0 ) {
  +ajp14-groups-add( env, ajp14-groups, value, ajp14 );
   } else if( strcmp( name, cachesize )==0 ) {
   ajp14-cache_sz=atoi( value );
   } else if( strcmp( name, lb_factor )==0 ) {
  @@ -567,6 +588,8 @@
   jk2_worker_ajp14_init(jk_env_t *env, jk_worker_t *ajp14)
   {
   int  rc;
  +int size;
  +int i;
   
   if( ajp14-cache_sz == -1 )
   ajp14-cache_sz=JK_OBJCACHE_DEFAULT_SZ;
  @@ -585,70 +608,55 @@
   ajp14-endpointCache=NULL;
   }
   
  -if( ajp14-channelName == NULL ) {
  -/* No channel was specified. Default to a channel, using
  -   the local part of the worker name to construct it. The type
  -   of the channel will be unix socket if a / is found, jni if
  -   the name is jni, and socket otherwise.
  -   
  -   If the channle is not found, create one.
  -*/
  -char *localName=strchr( ajp14-mbean-name, ':' );
  -if( localName==NULL || localName[1]=='\0' ) {
  -/* No local part, use the defaults */
  -ajp14-channelName=channel.socket;
  -} else {
  -char *prefix;
  -localName++;
  -if( strcmp( localName, jni ) == 0 ) {
  -/* Easy one */
  -ajp14-channelName=channel.jni;
  -}  else {
  -if( strchr( localName, '/' )) {
  -prefix=channel.apr:;
  -} else {
  -/* We could do more - if other channels are defined and
  -   we can guess it */
  -prefix=channel.socket:;
  -}
  -ajp14-channelName=ajp14-pool-calloc( env, ajp14-pool, strlen( 
localName )+
  -strlen( prefix ) + 2 );
  -strcpy( ajp14-channelName, prefix );
  -strcat( ajp14-channelName, localName );
  -}
  -}
  -}
  -
   if( ajp14-channel == NULL ) {
  -ajp14-channel= env-getByName( env, ajp14-channelName );
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp14.init(): No channel %s\n, ajp14-mbean-localName);
  +return JK_ERR;
   }
  

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-04-11 Thread costin

costin  02/04/11 12:34:56

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Fix channel initialization, better messages.
  
  Revision  ChangesPath
  1.7   +17 -15jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_worker_ajp13.c 27 Mar 2002 18:58:57 -  1.6
  +++ jk_worker_ajp13.c 11 Apr 2002 19:34:55 -  1.7
  @@ -213,6 +213,9 @@
 ajp14.connect() no channel %s\n, ae-worker-mbean-name );
   return JK_FALSE;
   }
  +
  +env-l-jkLog(env, env-l, JK_LOG_INFO,
  +  ajp14.connect() %s %s\n, ae-worker-channelName, 
channel-mbean-name );
   
   err=channel-open( env, channel, ae );
   
  @@ -293,8 +296,8 @@
   }
   
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -ajp14.service() error sending, retry on a new endpoint %s\n,
  -  e-worker-mbean-name);
  +ajp14.service() error sending, reconnect %s %s\n,
  +  e-worker-mbean-name, e-worker-channelName);
   
   channel-close( env, channel, e );
   
  @@ -628,23 +631,22 @@
   return JK_FALSE;
   }
   ajp14-channel = chB-object;
  -}
   
  -if( ajp14-channel == NULL ) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp14.init(): no channel found %s\n,
  -  ajp14-channelName);
  -return JK_FALSE;
  +if( ajp14-channel == NULL ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp14.init(): no channel found %s\n,
  +  ajp14-channelName);
  +return JK_FALSE;
  +}
  +rc=ajp14-workerEnv-initChannel( env, ajp14-workerEnv, ajp14-channel );
  +if( rc != JK_TRUE ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  ajp14.init(): channel init failed\n);
  +}
   }
  -
  +
   ajp14-channel-worker=ajp14;
   
  -rc=ajp14-channel-init( env, ajp14-channel );
  -if( rc != JK_TRUE ) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp14.init(): channel init failed\n);
  -return rc;
  -}
   
   return JK_TRUE;
   }
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c jk_worker_jni.c

2002-03-25 Thread costin

costin  02/03/25 19:04:24

  Modified:jk/native2/common jk_worker_ajp13.c jk_worker_jni.c
  Log:
  Update to the new interface changes, few fixes.
  
  Revision  ChangesPath
  1.5   +8 -4  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_worker_ajp13.c 25 Mar 2002 03:34:38 -  1.4
  +++ jk_worker_ajp13.c 26 Mar 2002 03:04:24 -  1.5
  @@ -480,6 +480,7 @@
   {
   jk_endpoint_t *e = NULL;
   jk_pool_t *endpointPool;
  +jk_bean_t *jkb;
   
   if( ajp14-secret ==NULL ) {
   }
  @@ -496,9 +497,10 @@
   }
   }
   
  -e = (jk_endpoint_t *)env-createInstance( env,ajp14-pool,  endpoint, NULL );
  -if( e==NULL )
  +jkb=env-createBean2( env,ajp14-pool,  endpoint, NULL );
  +if( jkb==NULL )
   return JK_FALSE;
  +e = (jk_endpoint_t *)jkb-object;
   e-worker = ajp14;
   
   *eP = e;
  @@ -581,7 +583,9 @@
   }
   }
   
  -ajp14-channel= env-getByName( env, ajp14-channelName );
  +if( ajp14-channel == NULL ) {
  +ajp14-channel= env-getByName( env, ajp14-channelName );
  +}
   
   if( ajp14-channel == NULL ) {
   jk_bean_t * chB=env-createBean( env, ajp14-workerEnv-pool, 
ajp14-channelName);
  @@ -677,6 +681,6 @@
   
   w-workerEnv=env-getByName( env, workerEnv );
   w-workerEnv-addWorker( env, w-workerEnv, w );
  -
  +
   return JK_TRUE;
   }
  
  
  
  1.6   +11 -6 jakarta-tomcat-connectors/jk/native2/common/jk_worker_jni.c
  
  Index: jk_worker_jni.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_jni.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_worker_jni.c   18 Mar 2002 18:45:25 -  1.5
  +++ jk_worker_jni.c   26 Mar 2002 03:04:24 -  1.6
  @@ -169,6 +169,7 @@
   jint rc = 0;
   char *str_config = NULL;
   jk_map_t *props=_this-workerEnv-initData;
  +jk_bean_t *chB;
   
   if(! _this || ! _this-worker_private) {
   env-l-jkLog(env, env-l, JK_LOG_EMERG,
  @@ -291,20 +292,21 @@
   stdout_name,
   stderr_name);
   
  -jniWorker-vm-detach(env, jniWorker-vm); 
  +jniWorker-vm-detach(env, jniWorker-vm);
  +
   
   _this-workerEnv-vm= jniWorker-vm;
   
   /* We can have a single jni channel per instance, the name is
  hardcoded */
  -_this-channel=env-createInstance(env, _this-pool,channel.jni,
  -   channel.jni);
  +chB=env-createBean2(env, _this-pool,channel.jni, );
   
  -if( _this-channel == NULL ) {
  +if( chB == NULL || chB-object==NULL ) {
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
 Error creating jni channel\n);
   return JK_FALSE;
   }
  +_this-channel=chB-object;
   if(rc) {
   env-l-jkLog(env, env-l, JK_LOG_INFO, 
 jni.init() Tomcat initialized OK, done\n);
  @@ -363,7 +365,8 @@
   {
   jk_worker_t *_this;
   jni_worker_data_t *jniData;
  -
  +jk_bean_t *jkb;
  +
   if(name==NULL) {
   env-l-jkLog(env, env-l, JK_LOG_EMERG, 
 jni.factory() NullPointerException name==null\n);
  @@ -388,7 +391,9 @@
   _this-pool=pool;
   
   /* XXX split it in VM11 and VM12 util */
  -jniData-vm=env-createInstance( env, pool, vm, vm );
  +jkb=env-createBean2( env, pool, vm,  );
  +if( jkb==NULL ) return JK_FALSE;
  +jniData-vm=jkb-object;
   
   jniData-jk_java_bridge_class  = NULL;
   jniData-jk_startup_method = NULL;
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c

2002-03-23 Thread costin

costin  02/03/23 09:27:44

  Modified:jk/native2/common jk_worker_ajp13.c
  Log:
  Create the endpoint using the factory method
  
  Revision  ChangesPath
  1.2   +5 -24 jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jk_worker_ajp13.c 20 Mar 2002 23:38:51 -  1.1
  +++ jk_worker_ajp13.c 23 Mar 2002 17:27:44 -  1.2
  @@ -501,31 +501,11 @@
   }
   }
   
  -endpointPool = ajp14-pool-create( env, ajp14-pool, HUGE_POOL_SIZE );
  -
  -e = (jk_endpoint_t *)endpointPool-alloc(env, endpointPool,
  -  sizeof(jk_endpoint_t));
  -if (e==NULL) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR,
  -  ajp14.get_endpoint OutOfMemoryException\n);
  +e = (jk_env_t *)env-createInstance( env, endpoint, NULL );
  +if( e==NULL )
   return JK_FALSE;
  -}
  -
  -e-pool = endpointPool;
  -
  -/* Init message storage areas.
  - */
  -e-request = jk2_msg_ajp_create( env, e-pool, 0);
  -e-reply = jk2_msg_ajp_create( env, e-pool, 0);
  -e-post = jk2_msg_ajp_create( env, e-pool, 0);
  -
  -e-reuse = JK_FALSE;
  -
  -e-cPool=endpointPool-create(env, endpointPool, HUGE_POOL_SIZE );
  -
   e-worker = ajp14;
  -e-channelData = NULL;
  -
  +
   *eP = e;
   return JK_TRUE;
   }
  @@ -573,7 +553,8 @@
   }
   
   if( ajp14-channelName == NULL ) {
  -/* Use default channel */
  +
  +
   ajp14-channelName=channel.default;
   }
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c jk_ajp14_worker.c

2002-03-20 Thread costin

costin  02/03/20 15:38:51

  Added:   jk/native2/common jk_worker_ajp13.c
  Removed: jk/native2/common jk_ajp14_worker.c
  Log:
  Renamed the ajp worker to follow the rest of the code naming scheme.
  
  Also reverted back to ajp13 - all 14 extensions will consist on
  additional headers, the protocol is backward compatible.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  /* = *
   *   *
   * The Apache Software License,  Version 1.1 *
   *   *
   *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
   *   All rights reserved.*
   *   *
   * = *
   *   *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *   *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *notice, this list of conditions and the following disclaimer.  *
   *   *
   * 2. Redistributions  in binary  form  must  reproduce the  above copyright *
   *notice,  this list of conditions  and the following  disclaimer in the *
   *documentation and/or other materials provided with the distribution.   *
   *   *
   * 3. The end-user documentation  included with the redistribution,  if any, *
   *must include the following acknowlegement: *
   *   *
   *   This product includes  software developed  by the Apache  Software *
   *Foundation http://www.apache.org/.  *
   *   *
   *Alternately, this acknowlegement may appear in the software itself, if *
   *and wherever such third-party acknowlegements normally appear. *
   *   *
   * 4. The names  The  Jakarta  Project,  Jk,  and  Apache  Software *
   *Foundation  must not be used  to endorse or promote  products derived *
   *from this  software without  prior  written  permission.  For  written *
   *permission, please contact [EMAIL PROTECTED].*
   *   *
   * 5. Products derived from this software may not be called Apache nor may *
   *Apache appear in their names without prior written permission of the *
   *Apache Software Foundation.*
   *   *
   * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES *
   * INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY *
   * AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL *
   * THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY *
   * DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL *
   * DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS *
   * OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION) *
   * HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT, *
   * STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
   * ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE *
   * POSSIBILITY OF SUCH DAMAGE.   *
   *   *
   * = *
   *   *
   * This software  consists of voluntary  contributions made  by many indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see http://www.apache.org/.   *
   *   *
   *