mturk       2004/08/10 11:01:26

  Modified:    ajp/proxy proxy_ajp.c
  Log:
  Fix the return codes. We can not return the APR error codes.
  
  Revision  Changes    Path
  1.15      +23 -24    jakarta-tomcat-connectors/ajp/proxy/proxy_ajp.c
  
  Index: proxy_ajp.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/proxy_ajp.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- proxy_ajp.c       9 Aug 2004 08:05:15 -0000       1.14
  +++ proxy_ajp.c       10 Aug 2004 18:01:26 -0000      1.15
  @@ -97,13 +97,12 @@
       return OK;
   }
    
  -static
  -apr_status_t ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
  -                                   proxy_conn_rec *conn, 
  -                                   conn_rec *origin, 
  -                                   proxy_server_conf *conf,
  -                                   apr_uri_t *uri,
  -                                   char *url, char *server_portstr)
  +static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
  +                                proxy_conn_rec *conn, 
  +                                conn_rec *origin, 
  +                                proxy_server_conf *conf,
  +                                apr_uri_t *uri,
  +                                char *url, char *server_portstr)
   {
       apr_status_t status;
       int result;
  @@ -118,10 +117,10 @@
       if (status != APR_SUCCESS) {
           conn->close++;
           ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
  -                     "proxy: request failed to %pI (%s)",
  +                     "proxy: AJP: request failed to %pI (%s)",
                        conn->worker->cp->addr,
                        conn->worker->hostname);
  -        return status;
  +        return HTTP_SERVICE_UNAVAILABLE;
       }
   
       /* read the first bloc of data */
  @@ -134,7 +133,7 @@
           ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                        "proxy: ap_get_brigade failed");
           apr_brigade_destroy(input_brigade);
  -        return status;
  +        return HTTP_INTERNAL_SERVER_ERROR;
       }
   
       /* have something */
  @@ -159,7 +158,7 @@
           if (status != APR_SUCCESS) {
                ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
                        "proxy: apr_brigade_flatten");
  -            return status;
  +            return HTTP_INTERNAL_SERVER_ERROR;
           }
   
           ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
  @@ -171,7 +170,7 @@
                                "proxy: request failed to %pI (%s)",
                                conn->worker->cp->addr,
                                conn->worker->hostname);
  -                return status;
  +                return HTTP_SERVICE_UNAVAILABLE;
               }
           }
       }
  @@ -184,7 +183,7 @@
                        "proxy: request failed to %pI (%s)",
                        conn->worker->cp->addr,
                        conn->worker->hostname);
  -        return status;
  +        return HTTP_SERVICE_UNAVAILABLE;
       }
   
       /* parse the reponse */
  @@ -194,7 +193,7 @@
                        "proxy: got response from %pI (%s)",
                        conn->worker->cp->addr,
                        conn->worker->hostname);
  -        return APR_SUCCESS;
  +        return HTTP_SERVICE_UNAVAILABLE;
       }
   
       /* XXXX: need logic to send the rest of the data */
  @@ -208,18 +207,17 @@
       }
    */
   
  -    return APR_SUCCESS;
  +    return OK;
   }
   
   /*
    * Process the AJP response, data already contains the first part of it.
    */
  -static
  -apr_status_t ap_proxy_ajp_process_response(apr_pool_t * p, request_rec *r,
  -                                            conn_rec *origin,
  -                                            proxy_conn_rec *backend,
  -                                            proxy_server_conf *conf,
  -                                            char *server_portstr) 
  +static int ap_proxy_ajp_process_response(apr_pool_t * p, request_rec *r,
  +                                         conn_rec *origin,
  +                                         proxy_conn_rec *backend,
  +                                         proxy_server_conf *conf,
  +                                         char *server_portstr) 
   {
       conn_rec *c = r->connection;
       apr_bucket *e;
  @@ -302,7 +300,7 @@
       conn_rec *origin = NULL;
       proxy_conn_rec *backend = NULL;
       int is_ssl = 0;
  -    const char *scheme = "ajp";
  +    const char *scheme = "AJP";
   
       /* Note: Memory pool allocation.
        * A downstream keepalive connection is always connected to the existence
  @@ -369,9 +367,10 @@
       if (status != OK)
           goto cleanup;
       /* Step Two: Make the Connection */
  -    status = ap_proxy_connect_backend(scheme, backend, worker, r->server);
  -    if (status != OK)
  +    if (ap_proxy_connect_backend(scheme, backend, worker, r->server)) {
  +        status = HTTP_SERVICE_UNAVAILABLE;
           goto cleanup;
  +    }
   #if 0
       /* XXX: we don't need to create the bound client connection */
   
  
  
  

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

Reply via email to