tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_global.h jk_lb_worker.c
Date Thu, 21 Apr 2005 11:18:44 GMT
mturk       2005/04/21 04:18:44

  Modified:    jk/native/common jk_ajp_common.c jk_global.h jk_lb_worker.c
  Log:
  Make sure the returned status codes are the same for ajp and lb
  workers.
  Status 503 if connection to tomcat fails.
  Status 502 is returned if tomcat faild in the middle of request.
  Status 400 is returned if client made faulty request
  Status 413 is returned if the headers are too large.
  Status 500 is returned in case of any other error.
  
  Revision  Changes    Path
  1.97      +7 -6      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.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- jk_ajp_common.c	11 Apr 2005 06:51:36 -0000	1.96
  +++ jk_ajp_common.c	21 Apr 2005 11:18:44 -0000	1.97
  @@ -1605,12 +1605,12 @@
   
       JK_TRACE_ENTER(l);
   
  +    if (is_error)
  +        *is_error = JK_HTTP_SERVER_ERROR;
  +
       if (e && e->endpoint_private && s && is_error) {
           ajp_endpoint_t *p = e->endpoint_private;
           op->request = jk_b_new(&(p->pool));
  -        /* Presume there will be no errors */
  -        *is_error = JK_HTTP_OK;
  -
           jk_b_set_buffer_size(op->request, DEF_BUFFER_SZ);
           jk_b_reset(op->request);
   
  @@ -1674,6 +1674,7 @@
   
                   err = ajp_get_reply(e, s, l, p, op);
                   if (err == JK_TRUE) {
  +                    *is_error = JK_HTTP_OK;
                       /* Done with the request */
                       JK_TRACE_EXIT(l);
                       return JK_TRUE;
  @@ -1686,7 +1687,7 @@
                        * operation is no more recoverable
                        */
                       if (!op->recoverable) {
  -                        *is_error = JK_HTTP_SERVER_ERROR;
  +                        *is_error = JK_HTTP_BAD_GATEWAY;
                           jk_log(l, JK_LOG_ERROR,
                                  "receiving reply from tomcat failed "
                                  "without recovery in send loop %d", i);
  @@ -1728,7 +1729,7 @@
               /* Get another connection from the pool and try again */
               ajp_next_connection(p, l);
           }
  -
  +        *is_error = JK_HTTP_SERVER_BUSY;
           /* Log the error only once per failed request. */
           jk_log(l, JK_LOG_ERROR,
                  "Error connecting to tomcat. Tomcat is probably not started "
  
  
  
  1.47      +9 -6      jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- jk_global.h	26 Mar 2005 09:28:56 -0000	1.46
  +++ jk_global.h	21 Apr 2005 11:18:44 -0000	1.47
  @@ -174,11 +174,14 @@
   /* HTTP Error codes
    */
   
  -#define JK_HTTP_OK              200
  -#define JK_HTTP_BAD_REQUEST     400
  -#define JK_REQUEST_TOO_LARGE    413
  -#define JK_HTTP_SERVER_ERROR    500
  -#define JK_HTTP_SERVER_BUSY     503
  +#define JK_HTTP_OK               200
  +#define JK_HTTP_BAD_REQUEST      400
  +#define JK_REQUEST_TOO_LARGE     413
  +#define JK_HTTP_SERVER_ERROR     500
  +#define JK_HTTP_NOT_IMPLEMENTED  501
  +#define JK_HTTP_BAD_GATEWAY      502
  +#define JK_HTTP_SERVER_BUSY      503
  +#define JK_HTTP_GATEWAY_TIME_OUT 504
   
   
   /*
  
  
  
  1.77      +3 -3      jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- jk_lb_worker.c	13 Apr 2005 12:40:03 -0000	1.76
  +++ jk_lb_worker.c	21 Apr 2005 11:18:44 -0000	1.77
  @@ -668,7 +668,7 @@
                   jk_log(l, JK_LOG_ERROR,
                          "All tomcat instances failed, no more workers left");
                   JK_TRACE_EXIT(l);
  -                *is_error = JK_HTTP_SERVER_ERROR;
  +                *is_error = JK_HTTP_SERVER_BUSY;
                   return JK_FALSE;
               }
               --num_of_workers;
  @@ -677,7 +677,7 @@
           jk_log(l, JK_LOG_INFO,
                  "All tomcat instances are busy or in error state");
           JK_TRACE_EXIT(l);
  -        /* Set error to Server busy */
  +        /* Set error to Timeout */
           *is_error = JK_HTTP_SERVER_BUSY;
           return JK_FALSE;
       }
  
  
  

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


Mime
View raw message