hgomez      2003/09/25 08:22:09

  Modified:    jk/native/common jk_ajp14_worker.h jk_worker.c
                        jk_ajp_common.h jk_ajp14_worker.c jk_ajp_common.c
                        jk_ajp13.h jk_ajp13.c jk_msg_buff.c
                        jk_worker_list.h jk_service.h jk_md5.c
                        jk_ajp13_worker.c jk_context.h jk_ajp14.h jk_util.h
                        jk_context.c jk_ajp14.c jk_util.c
               jk/native/apache-2.0 mod_jk.c
               jk/native/apache-1.3 mod_jk.c
  Log:
  New code to handle HANG tomcats.
  
  Basically add PING/PONG in ajp protocol which will
  require Tomcat 3.3.2, 4.1.28, 5.0.13
  
  Revision  Changes    Path
  1.8       +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.h
  
  Index: jk_ajp14_worker.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_ajp14_worker.h 21 Jun 2002 15:28:56 -0000      1.7
  +++ jk_ajp14_worker.h 25 Sep 2003 15:22:07 -0000      1.8
  @@ -57,7 +57,7 @@
   
   /***************************************************************************
    * Description: ajpv14 worker header file                                  *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   
  
  
  
  1.12      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_worker.c
  
  Index: jk_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_worker.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_worker.c       4 Dec 2001 19:44:23 -0000       1.11
  +++ jk_worker.c       25 Sep 2003 15:22:08 -0000      1.12
  @@ -59,8 +59,8 @@
   /***************************************************************************
    * Description: Workers controller                                         *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   #define _PLACE_WORKER_LIST_HERE
  
  
  
  1.19      +13 -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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_ajp_common.h   14 Mar 2003 13:36:35 -0000      1.18
  +++ jk_ajp_common.h   25 Sep 2003 15:22:08 -0000      1.19
  @@ -58,8 +58,8 @@
   /***************************************************************************
    * Description: common stuff for bi-directional protocol ajp13/ajp14.      *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   #ifndef JK_AJP_COMMON_H
  @@ -229,7 +229,9 @@
   #define AJP_HEADER_SZ_LEN         (2)
   #define CHUNK_BUFFER_PAD          (12)
   #define AJP_DEF_CACHE_TIMEOUT     (15)
  -
  +#define AJP_DEF_CONNECT_TIMEOUT   (0)                /* NO CONNECTION TIMEOUT => NO 
PING/PONG */
  +#define AJP_DEF_REPLY_TIMEOUT     (0)                /* NO REPLY TIMEOUT            
          */
  +#define AJP_DEF_PREPOST_TIMEOUT   (0)                /* NO PREPOST TIMEOUT => NO 
PING/PONG    */
   
   struct jk_res_data {
       int         status;
  @@ -298,6 +300,13 @@
       * Handle Cache Timeouts
       */
       unsigned cache_timeout;
  +
  +     /*
  +     * Handle Connection/Reply Timeouts
  +     */
  +     unsigned connect_timeout;       /* connect ping/pong delay in ms (0 means 
disabled)                                                     */
  +     unsigned reply_timeout;     /* reply timeout delay in ms (0 means disabled)    
                                                         */
  +     unsigned prepost_timeout;       /* before sending a request ping/pong timeout 
delay in ms (0 means disabled)    */
   }; 
    
   
  @@ -315,7 +324,7 @@
       int sd;
       int reuse;
       jk_endpoint_t endpoint;
  -
  +     
       unsigned left_bytes_to_send;
   
       /* time of the last request
  
  
  
  1.17      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c
  
  Index: jk_ajp14_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_ajp14_worker.c 4 Dec 2001 19:44:23 -0000       1.16
  +++ jk_ajp14_worker.c 25 Sep 2003 15:22:08 -0000      1.17
  @@ -57,8 +57,8 @@
   
   /***************************************************************************
    * Description: AJP14 next generation Bi-directional protocol.             *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   #include "jk_context.h"
  
  
  
  1.39      +159 -13   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.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- jk_ajp_common.c   24 Jul 2003 08:17:10 -0000      1.38
  +++ jk_ajp_common.c   25 Sep 2003 15:22:08 -0000      1.39
  @@ -58,8 +58,8 @@
   /***************************************************************************
    * Description: common stuff for bi-directional protocols ajp13/ajp14.     *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   
  @@ -648,6 +648,82 @@
       }
   }
   
  +/*
  + * Wait input event on ajp_endpoint for timeout ms
  + */
  +int ajp_is_input_event(ajp_endpoint_t *ae,
  +                       int            timeout,
  +                       jk_logger_t   *l)
  +{
  +     fd_set  rset; 
  +     fd_set  eset; 
  +     struct  timeval tv;
  +     int             rc;
  +     
  +     FD_ZERO(&rset);
  +     FD_SET(ae->sd, &rset);
  +     FD_SET(ae->sd, &eset);
  +
  +     tv.tv_sec  = timeout / 1000;
  +     tv.tv_usec = (timeout % 1000) * 1000;
  +
  +     rc = select(ae->sd + 1, &rset, NULL, &eset, &tv);
  +      
  +    if ((rc < 1) || (FD_ISSET(ae->sd, &eset)))
  +     {
  +             jk_log(l, JK_LOG_ERROR, "Error ajp13:is_input_event: error during 
select [%d]\n", rc);
  +             return JK_FALSE;
  +     }
  +     
  +     return ((FD_ISSET(ae->sd, &rset)) ? JK_TRUE : JK_FALSE) ;
  +}
  +
  +                         
  +/*
  + * Handle the PING/PONG initial query
  + */
  +int ajp_handle_ping_pong(ajp_endpoint_t *ae,
  +                                              int                    timeout,
  +                         jk_logger_t    *l)
  +{
  +     int     cmd;
  +     jk_msg_buf_t * msg;
  +
  +     msg = jk_b_new(&ae->pool);
  +     jk_b_set_buffer_size(msg, 16);  /* 16 is way too large but I'm lazy :-) */
  +     jk_b_reset(msg);
  +     jk_b_append_byte(msg, AJP13_PING_REQUEST); 
  +
  +     /* Send Ping query */           
  +     if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
  +     {
  +             jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: can't send ping query\n");
  +             return JK_FALSE;
  +     }
  +             
  +     /* wait for Pong reply for timeout milliseconds
  +      */
  +     if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
  +     {
  +             jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: timeout in reply pong\n");
  +             return JK_FALSE;
  +     }
  +             
  +     /* Read and check for Pong reply 
  +      */
  +     if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
  +     {
  +             jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: awaited reply pong, not 
received\n");
  +             return JK_FALSE;
  +     }
  +     
  +     if ((cmd = jk_b_get_byte(msg)) != AJP13_PONG_REPLY) {
  +             jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: awaited reply pong, 
received %d instead\n", cmd);
  +             return JK_FALSE;
  +     }
  +
  +     return JK_TRUE;
  +}
   
   int ajp_connect_to_endpoint(ajp_endpoint_t *ae,
                               jk_logger_t    *l)
  @@ -669,6 +745,10 @@
               if (ae->worker->logon != NULL)
                   return (ae->worker->logon(ae, l));
   
  +                     /* should we send a PING to validate connection ? */
  +                     if (ae->worker->connect_timeout != 0)
  +                             return (ajp_handle_ping_pong(ae, 
ae->worker->connect_timeout, l));
  +                             
               return JK_TRUE;
           }
       }
  @@ -922,25 +1002,42 @@
                               ajp_endpoint_t *ae,
                               ajp_operation_t *op)
   {
  +     int err = 0;
  +     
       /* Up to now, we can recover */
       op->recoverable = JK_TRUE;
   
       /*
        * First try to reuse open connections...
       */
  -    while ((ae->sd > 0) &&
  -           !ajp_connection_tcp_send_message(ae, op->request, l)) {
  -        jk_log(l, JK_LOG_INFO,
  -               "Error sending request try another pooled connection\n");
  -        jk_close_socket(ae->sd);
  -        ae->sd = -1;
  -        ajp_reuse_connection(ae, l);
  -    }
  -
  +    while ((ae->sd > 0))
  +    {
  +     err = 0;
  +     
  +     /* handle ping/pong before request if timeout is set */
  +             if (ae->worker->prepost_timeout != 0)
  +             {
  +                     if (ajp_handle_ping_pong(ae, ae->worker->prepost_timeout, l) 
== JK_FALSE)
  +                             err++;
  +             }       
  +
  +        if (err || ajp_connection_tcp_send_message(ae, op->request, l) == JK_FALSE) 
{
  +             jk_log(l, JK_LOG_INFO,
  +                    "Error sending request try another pooled connection\n");
  +             jk_close_socket(ae->sd);
  +             ae->sd = -1;
  +             ajp_reuse_connection(ae, l);
  +             break;
  +         }
  +     }
  +     
       /*
        * If we failed to reuse a connection, try to reconnect.
        */
       if (ae->sd < 0) {
  +
  +     /* no need to handle ping/pong here since it should be at connection time */
  +
           if (ajp_connect_to_endpoint(ae, l) == JK_TRUE) {
               /*
                * After we are connected, each error that we are going to
  @@ -1133,6 +1230,19 @@
       while(1) {
           int rc = 0;
   
  +             /* If we set a reply timeout, check it something is available */
  +             if (p->worker->reply_timeout != 0)
  +             {
  +                     if (ajp_is_input_event(p, p->worker->reply_timeout, l) == 
JK_FALSE)
  +                     {
  +                 jk_log(l, JK_LOG_ERROR,
  +                        "Timeout will waiting reply from tomcat. "
  +                        "Tomcat is down, stopped or network problems.\n");
  +
  +                             return JK_FALSE;
  +                     }
  +             }
  +             
           if(!ajp_connection_tcp_get_message(p, op->reply, l)) {
               jk_log(l, JK_LOG_ERROR,
                      "Error reading reply from tomcat. "
  @@ -1413,17 +1523,53 @@
           int cache_sz = jk_get_worker_cache_size(props, p->name, cache);
           int socket_timeout =
              jk_get_worker_socket_timeout(props, p->name, AJP13_DEF_TIMEOUT);
  +
  +        jk_log(l, JK_LOG_DEBUG,
  +               "In jk_worker_t::init, setting socket timeout to %d\n",
  +               socket_timeout);
  +
           int socket_keepalive =
               jk_get_worker_socket_keepalive(props, p->name, JK_FALSE);
  +
  +        jk_log(l, JK_LOG_DEBUG,
  +               "In jk_worker_t::init, setting socket keepalive to %d\n",
  +               socket_keepalive);
  +
           int cache_timeout =
               jk_get_worker_cache_timeout(props, p->name, AJP_DEF_CACHE_TIMEOUT);
   
           jk_log(l, JK_LOG_DEBUG,
  -               "In jk_worker_t::init, setting socket timeout to %d\n",
  -               socket_timeout);
  +               "In jk_worker_t::init, setting cache timeout to %d\n",
  +               cache_timeout);
  +
  +        int connect_timeout =
  +            jk_get_worker_connect_timeout(props, p->name, AJP_DEF_CONNECT_TIMEOUT);
  +
  +     jk_log(l, JK_LOG_DEBUG,
  +                "In jk_worker_t::init, setting connect timeout to %d\n",
  +                     connect_timeout);
  +
  +        int reply_timeout =
  +            jk_get_worker_reply_timeout(props, p->name, AJP_DEF_REPLY_TIMEOUT);
  +
  +        jk_log(l, JK_LOG_DEBUG,
  +                "In jk_worker_t::init, setting reply timeout to %d\n",
  +            reply_timeout);
  +
  +        int prepost_timeout =
  +            jk_get_worker_reply_timeout(props, p->name, AJP_DEF_PREPOST_TIMEOUT);
  +
  +        jk_log(l, JK_LOG_DEBUG,
  +                "In jk_worker_t::init, setting prepost timeout to %d\n",
  +            prepost_timeout);
  +
           p->socket_timeout = socket_timeout;
           p->keepalive = socket_keepalive;
           p->cache_timeout = cache_timeout;
  +        p->connect_timeout = connect_timeout;
  +        p->reply_timeout = reply_timeout;
  +        p->prepost_timeout = prepost_timeout;
  +        
           /* 
            *  Need to initialize secret here since we could return from inside
            *  of the following loop
  
  
  
  1.10      +13 -1     jakarta-tomcat-connectors/jk/native/common/jk_ajp13.h
  
  Index: jk_ajp13.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp13.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_ajp13.h        25 Jun 2002 07:08:26 -0000      1.9
  +++ jk_ajp13.h        25 Sep 2003 15:22:08 -0000      1.10
  @@ -127,6 +127,18 @@
   #define JK_AJP13_SHUTDOWN           (unsigned char)7
   
   /*
  + * Check if the container is alive
  + */
  +#define AJP13_PING_REQUEST          (unsigned char)8
  +
  +/*
  + * Reply from the container to alive request
  + */
  +#define AJP13_PONG_REPLY            (unsigned char)9
  +
  +
  +
  +/*
    * Functions
    */
   
  
  
  
  1.7       +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp13.c
  
  Index: jk_ajp13.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp13.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_ajp13.c        4 Dec 2001 19:48:41 -0000       1.6
  +++ jk_ajp13.c        25 Sep 2003 15:22:08 -0000      1.7
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Experimental bi-directionl protocol handler.               *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   
  
  
  
  1.13      +2 -2      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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_msg_buff.c     20 Sep 2002 11:28:16 -0000      1.12
  +++ jk_msg_buff.c     25 Sep 2003 15:22:08 -0000      1.13
  @@ -59,8 +59,8 @@
    * Description: Data marshaling. XDR like                                  *
    * Author:      Costin <[EMAIL PROTECTED]>                              *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   #include "jk_pool.h"
  
  
  
  1.7       +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_worker_list.h
  
  Index: jk_worker_list.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_worker_list.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_worker_list.h  4 Dec 2001 19:48:41 -0000       1.6
  +++ jk_worker_list.h  25 Sep 2003 15:22:08 -0000      1.7
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Worker list                                                *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   
  
  
  
  1.14      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_service.h
  
  Index: jk_service.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_service.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_service.h      6 Feb 2002 19:11:23 -0000       1.13
  +++ jk_service.h      25 Sep 2003 15:22:08 -0000      1.14
  @@ -62,8 +62,8 @@
    *              JVM connection point                                       *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
    * Author:      Dan Milstein <[EMAIL PROTECTED]>                            *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   #ifndef JK_SERVICE_H
  
  
  
  1.8       +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_md5.c
  
  Index: jk_md5.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_md5.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_md5.c  11 Apr 2002 21:50:03 -0000      1.7
  +++ jk_md5.c  25 Sep 2003 15:22:08 -0000      1.8
  @@ -102,7 +102,7 @@
   
   /***************************************************************************
    * Description: MD5 encoding wrapper                                       *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   
  
  
  
  1.12      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp13_worker.c
  
  Index: jk_ajp13_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp13_worker.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_ajp13_worker.c 4 Dec 2001 19:48:41 -0000       1.11
  +++ jk_ajp13_worker.c 25 Sep 2003 15:22:08 -0000      1.12
  @@ -59,8 +59,8 @@
    * Description: Bi-directional protocol.                                   *
    * Author:      Costin <[EMAIL PROTECTED]>                              *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   #include "jk_ajp13_worker.h"
  
  
  
  1.5       +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_context.h
  
  Index: jk_context.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_context.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_context.h      29 Jun 2001 14:55:22 -0000      1.4
  +++ jk_context.h      25 Sep 2003 15:22:08 -0000      1.5
  @@ -57,7 +57,7 @@
   
   /***************************************************************************
    * Description: Context Stuff (Autoconf)                                   *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   #ifndef JK_CONTEXT_H
  
  
  
  1.10      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp14.h
  
  Index: jk_ajp14.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_ajp14.h        4 Dec 2001 19:44:23 -0000       1.9
  +++ jk_ajp14.h        25 Sep 2003 15:22:08 -0000      1.10
  @@ -57,7 +57,7 @@
   
   /***************************************************************************
    * Description: Next generation bi-directional protocol handler.           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   #ifndef JK_AJP14_H
  
  
  
  1.12      +14 -2     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_util.h 8 May 2003 13:17:58 -0000       1.11
  +++ jk_util.h 25 Sep 2003 15:22:08 -0000      1.12
  @@ -58,8 +58,8 @@
   /***************************************************************************
    * Description: Various utility functions                                  *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   #ifndef _JK_UTIL_H
   #define _JK_UTIL_H
  @@ -121,6 +121,18 @@
   int jk_get_worker_cache_timeout(jk_map_t *m,
                                const char *wname,
                                int def);
  +
  +int jk_get_worker_connect_timeout(jk_map_t *m,
  +                                  const char *wname,
  +                                  int def);
  +
  +int jk_get_worker_reply_timeout(jk_map_t *m,
  +                                const char *wname,
  +                                 int def);
  +
  +int jk_get_prepost_timeout(jk_map_t *m,
  +                           const char *wname,
  +                           int def);
   
   char * jk_get_worker_secret_key(jk_map_t *m,
                                   const char *wname);
  
  
  
  1.8       +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_context.c
  
  Index: jk_context.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_context.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_context.c      13 Oct 2001 18:49:39 -0000      1.7
  +++ jk_context.c      25 Sep 2003 15:22:08 -0000      1.8
  @@ -57,7 +57,7 @@
   
   /***************************************************************************
    * Description: Context handling (Autoconf)                                *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                           *
    ***************************************************************************/
   
  
  
  
  1.17      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c
  
  Index: jk_ajp14.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_ajp14.c        4 Dec 2001 19:44:23 -0000       1.16
  +++ jk_ajp14.c        25 Sep 2003 15:22:08 -0000      1.17
  @@ -58,8 +58,8 @@
   
   /***************************************************************************
    * Description: Next generation bi-directional protocol handler.           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   
  
  
  
  1.24      +50 -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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jk_util.c 16 May 2003 00:36:18 -0000      1.23
  +++ jk_util.c 25 Sep 2003 15:22:08 -0000      1.24
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Utility functions (mainly configuration)                   *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
  + * Author:      Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                          *
    ***************************************************************************/
   
  @@ -85,6 +85,9 @@
   #define TYPE_OF_WORKER              ("type")
   #define CACHE_OF_WORKER             ("cachesize")
   #define CACHE_TIMEOUT_OF_WORKER     ("cache_timeout")
  +#define CONNECT_TIMEOUT_OF_WORKER    ("connect_timeout")
  +#define PREPOST_TIMEOUT_OF_WORKER    ("prepost_timeout")
  +#define REPLY_TIMEOUT_OF_WORKER      ("reply_timeout")
   #define SOCKET_TIMEOUT_OF_WORKER    ("socket_timeout")
   #define SOCKET_KEEPALIVE_OF_WORKER  ("socket_keepalive")
   #define LOAD_FACTOR_OF_WORKER       ("lbfactor")
  @@ -440,6 +443,51 @@
       }
   
       sprintf(buf, "%s.%s.%s", PREFIX_OF_WORKER, wname, CACHE_TIMEOUT_OF_WORKER);
  +
  +    return map_get_int(m, buf, def);
  +}
  +
  +int jk_get_worker_connect_timeout(jk_map_t *m,
  +                                  const char *wname,
  +                                  int def)
  +{
  +    char buf[1024];
  +
  +    if(!m || !wname) {
  +        return -1;
  +    }
  +
  +    sprintf(buf, "%s.%s.%s", PREFIX_OF_WORKER, wname, CONNECT_TIMEOUT_OF_WORKER);
  +
  +    return map_get_int(m, buf, def);
  +}
  +
  +int jk_get_worker_prepost_timeout(jk_map_t *m,
  +                                  const char *wname,
  +                                  int def)
  +{
  +    char buf[1024];
  +
  +    if(!m || !wname) {
  +        return -1;
  +    }
  +
  +    sprintf(buf, "%s.%s.%s", PREFIX_OF_WORKER, wname, PREPOST_TIMEOUT_OF_WORKER);
  +
  +    return map_get_int(m, buf, def);
  +}
  +
  +int jk_get_worker_reply_timeout(jk_map_t *m,
  +                                const char *wname,
  +                                int def)
  +{
  +    char buf[1024];
  +
  +    if(!m || !wname) {
  +        return -1;
  +    }
  +
  +    sprintf(buf, "%s.%s.%s", PREFIX_OF_WORKER, wname, REPLY_TIMEOUT_OF_WORKER);
   
       return map_get_int(m, buf, def);
   }
  
  
  
  1.85      +2 -2      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.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- mod_jk.c  29 Aug 2003 14:10:31 -0000      1.84
  +++ mod_jk.c  25 Sep 2003 15:22:09 -0000      1.85
  @@ -59,7 +59,7 @@
   /***************************************************************************
    * Description: Apache 2 plugin for Jakarta/Tomcat                         *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - *              Henri Gomez <[EMAIL PROTECTED]>                               *
  + *              Henri Gomez <[EMAIL PROTECTED]>                            *
    * Version:     $Revision$                                          *
    ***************************************************************************/
   
  
  
  
  1.43      +2 -2      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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_jk.c  26 Aug 2003 04:32:59 -0000      1.42
  +++ mod_jk.c  25 Sep 2003 15:22:09 -0000      1.43
  @@ -60,8 +60,8 @@
    *              See ../common/jk_service.h for general mod_jk info         *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
    *              Dan Milstein <[EMAIL PROTECTED]>                            *
  - *              Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision$                                           *
  + *              Henri Gomez <[EMAIL PROTECTED]>                            *
  + * Version:     $Revision$                                          *
    ***************************************************************************/
   
   /*
  
  
  

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

Reply via email to