mturk       2005/02/17 05:25:36

  Modified:    jk/native/common jk_ajp_common.c
  Log:
  Check if socket is connected before prepost cping/cpong.
  If the socket is not connected it will fail anyhow.
  
  Revision  Changes    Path
  1.88      +14 -10    
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.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- jk_ajp_common.c   17 Feb 2005 12:40:54 -0000      1.87
  +++ jk_ajp_common.c   17 Feb 2005 13:25:36 -0000      1.88
  @@ -843,8 +843,9 @@
                      "connected sd = %d to %s",
                      ae->sd, jk_dump_hinfo(&ae->worker->worker_inet_addr, 
buf));
   
  -            /* set last_access */
  -            ae->last_access = time(NULL);
  +            /* set last_access only if needed */
  +            if (ae->worker->cache_timeout > 0 || ae->worker->recycle_timeout 
> 0)
  +                ae->last_access = time(NULL);
               if (ae->worker->socket_timeout) {
                   int rc = 0;
                   if ((rc = jk_is_socket_connected(ae->sd, 
ae->worker->socket_timeout)) != 1) {
  @@ -1159,13 +1160,7 @@
        */
       while ((ae->sd > 0)) {
           err = 0;
  -        /* handle cping/cpong before request if timeout is set */
  -        if (ae->worker->prepost_timeout != 0) {
  -            if (ajp_handle_cping_cpong(ae, ae->worker->prepost_timeout, l) ==
  -                JK_FALSE)
  -                err++;
  -        }
  -        else if (ae->worker->socket_timeout) {
  +        if (ae->worker->socket_timeout) {
               int rc = 0;
               if ((rc = jk_is_socket_connected(ae->sd, 
ae->worker->socket_timeout)) != 1) {
                       jk_log(l, JK_LOG_INFO,
  @@ -1175,6 +1170,15 @@
                   err++;
               }
           }
  +        else if (ae->worker->prepost_timeout != 0 && !err) {
  +            /* handle cping/cpong if prepost_timeout is set
  +             * If the socket is disconnected no need to handle
  +             * the cping/cpong
  +             */
  +            if (ajp_handle_cping_cpong(ae, ae->worker->prepost_timeout, l) ==
  +                JK_FALSE)
  +                err++;
  +        }
   
           /* If we got an error or can't send data, then try to get a pooled
            * connection and try again.  If we are succesful, break out of this
  
  
  

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

Reply via email to