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/ajp/proxy mod_proxy.h proxy_util.c
Date Wed, 04 Aug 2004 12:31:12 GMT
mturk       2004/08/04 05:31:12

  Modified:    ajp/proxy mod_proxy.h proxy_util.c
  Log:
  Add ap_proxy_pre_request API function.
  It calls the actual module pre_request hook if present
  
  Revision  Changes    Path
  1.11      +4 -2      jakarta-tomcat-connectors/ajp/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/mod_proxy.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- mod_proxy.h	4 Aug 2004 08:56:24 -0000	1.10
  +++ mod_proxy.h	4 Aug 2004 12:31:12 -0000	1.11
  @@ -249,11 +249,13 @@
   #endif
   };
   
  -/* data structure for set/get module_config */
  +/* per connection data structure for set/get module_config */
   typedef struct {
       char                  *url;         /* rewtitten url */
       struct proxy_balancer *balancer;    /* load balancer to use */
       proxy_worker          *worker;      /* most suitable worker */
  +    proxy_conn_rec        *conn_rec;
  +    proxy_conn            *conn;
       void                  *opaque;      /* module private data */
   } proxy_module_conf;
   
  @@ -350,7 +352,7 @@
   PROXY_DECLARE(struct proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p, proxy_server_conf
*conf, const char *url);
   PROXY_DECLARE(const char *) ap_proxy_add_balancer(struct proxy_balancer **balancer, apr_pool_t
*p, proxy_server_conf *conf, const char *url);
   PROXY_DECLARE(void) ap_proxy_add_worker_to_balancer(struct proxy_balancer *balancer, proxy_worker
*worker);
  -
  +PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker, struct proxy_balancer **balancer,
request_rec *r, proxy_server_conf *conf, char **url);
   
   /* For proxy_util */
   extern module PROXY_DECLARE_DATA proxy_module;
  
  
  
  1.5       +41 -0     jakarta-tomcat-connectors/ajp/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/proxy_util.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- proxy_util.c	4 Aug 2004 07:44:34 -0000	1.4
  +++ proxy_util.c	4 Aug 2004 12:31:12 -0000	1.5
  @@ -1192,6 +1192,47 @@
   
   }
   
  +PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
  +                                        struct proxy_balancer **balancer,
  +                                        request_rec *r,
  +                                        proxy_server_conf *conf, char **url)
  +{
  +    int access_status;
  +
  +    access_status = proxy_run_pre_request(worker, balancer, r, conf, url);
  +    if (access_status == DECLINED && *balancer == NULL) {
  +        *worker = ap_proxy_get_worker(r->pool, conf, *url);
  +        if (*worker) {
  +            *balancer = NULL;
  +            access_status = OK;
  +        }
  +        else
  +            access_status = DECLINED;
  +    }
  +    else if (access_status == DECLINED && balancer != NULL) {
  +        /* All the workers are busy */
  +        access_status = HTTP_SERVICE_UNAVAILABLE;
  +    }
  +    return access_status;
  +}
  +
  +PROXY_DECLARE(int) ap_proxy_post_request(proxy_worker *worker,
  +                                         struct proxy_balancer *balancer,
  +                                         request_rec *r,
  +                                         proxy_server_conf *conf)
  +{
  +    int access_status;
  +    if (balancer)
  +        access_status = proxy_run_post_request(worker, balancer, r, conf);
  +    else { 
  +        
  +
  +        access_status = OK;
  +    }
  +
  +    return access_status;
  +}
  +
   PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock,
                                                  const char *proxy_function,
                                                  apr_sockaddr_t *backend_addr,
  
  
  

---------------------------------------------------------------------
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