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.c proxy_util.c mod_proxy.h
Date Thu, 05 Aug 2004 14:08:19 GMT
mturk       2004/08/05 07:08:19

  Modified:    ajp/proxy mod_proxy.c proxy_util.c mod_proxy.h
  Log:
  Remove proxy_mdule_conf.
  We will change the scheme hook api to include the worker.
  
  Revision  Changes    Path
  1.24      +0 -24     jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- mod_proxy.c	5 Aug 2004 13:45:44 -0000	1.23
  +++ mod_proxy.c	5 Aug 2004 14:08:19 -0000	1.24
  @@ -475,7 +475,6 @@
       long maxfwd;
       proxy_balancer *balancer = NULL;
       proxy_worker *worker = NULL;
  -    proxy_module_conf *mconf;
   
       /* is this for us? */
       if (!r->proxyreq || !r->filename || strncmp(r->filename, "proxy:", 6) != 0)
  @@ -560,29 +559,6 @@
       access_status = ap_proxy_pre_request(&worker, &balancer, r, conf, &url);
       if (access_status != OK)
           return access_status;
  -    
  -    /* only use stored info for top-level pages. Sub requests don't share 
  -     * in keepalives
  -     */
  -    if (!r->main) {
  -        mconf = (proxy_module_conf *)ap_get_module_config(r->connection->conn_config,
  -                                                          &proxy_module);
  -    }
  -    /* create space for state information */
  -    if (!mconf) {
  -        mconf = apr_pcalloc(r->connection->pool, sizeof(proxy_module_conf));
  -        if (!r->main) {
  -            ap_set_module_config(r->connection->conn_config,
  -                                 &proxy_module, mconf);
  -        }
  -    }
  -    /* use the current balancer and worker. 
  -     * the proxy_conn will be set in particular scheme handler
  -     * if not already set.
  -     */ 
  -    mconf->balancer = balancer;
  -    mconf->worker   = worker;
  -    mconf->url      = url;
       
       /* firstly, try a proxy, unless a NoProxy directive is active */
       if (!direct_connect) {
  
  
  
  1.12      +13 -12    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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- proxy_util.c	5 Aug 2004 13:45:44 -0000	1.11
  +++ proxy_util.c	5 Aug 2004 14:08:19 -0000	1.12
  @@ -1398,7 +1398,8 @@
   PROXY_DECLARE(apr_status_t)
   ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
                                 proxy_server_conf *conf,
  -                              proxy_module_conf *mconf,
  +                              proxy_worker *worker,
  +                              proxy_conn_rec *conn,
                                 apr_pool_t *ppool,
                                 apr_uri_t *uri,
                                 char **url,
  @@ -1433,11 +1434,11 @@
        */
       /* are we connecting directly, or via a proxy? */
       if (proxyname) {
  -        mconf->conn_rec->hostname = apr_pstrdup(ppool, proxyname);
  -        mconf->conn_rec->port = proxyport;
  +        conn->hostname = apr_pstrdup(ppool, proxyname);
  +        conn->port = proxyport;
       } else {
  -        mconf->conn_rec->hostname = apr_pstrdup(ppool, uri->hostname);
  -        mconf->conn_rec->port = uri->port;
  +        conn->hostname = apr_pstrdup(ppool, uri->hostname);
  +        conn->port = uri->port;
           *url = apr_pstrcat(p, uri->path, uri->query ? "?" : "",
                              uri->query ? uri->query : "",
                              uri->fragment ? "#" : "",
  @@ -1448,16 +1449,16 @@
        * If dynamic change is needed then set the addr to NULL
        * inside dynamic config to force the lookup.
        */
  -    if (!mconf->worker->cp->addr)
  -        err = apr_sockaddr_info_get(&(mconf->worker->cp->addr),
  -                                    mconf->conn_rec->hostname, APR_UNSPEC,
  -                                    mconf->conn_rec->port, 0,
  -                                    mconf->worker->cp->pool);
  +    if (!worker->cp->addr)
  +        err = apr_sockaddr_info_get(&(worker->cp->addr),
  +                                    conn->hostname, APR_UNSPEC,
  +                                    conn->port, 0,
  +                                    worker->cp->pool);
   
       if (err != APR_SUCCESS) {
           return ap_proxyerror(r, HTTP_BAD_GATEWAY,
                                apr_pstrcat(p, "DNS lookup failure for: ",
  -                                         mconf->conn_rec->hostname, NULL));
  +                                         conn->hostname, NULL));
       }
   
       /* Get the server port for the Via headers */
  @@ -1472,7 +1473,7 @@
       }
   
       /* check if ProxyBlock directive on this host */
  -    if (OK != ap_proxy_checkproxyblock(r, conf, mconf->worker->cp->addr)) {
  +    if (OK != ap_proxy_checkproxyblock(r, conf, worker->cp->addr)) {
           return ap_proxyerror(r, HTTP_FORBIDDEN,
                                "Connect to remote machine blocked");
       }
  
  
  
  1.16      +1 -12     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- mod_proxy.h	5 Aug 2004 13:45:44 -0000	1.15
  +++ mod_proxy.h	5 Aug 2004 14:08:19 -0000	1.16
  @@ -175,7 +175,6 @@
   
   typedef struct proxy_balancer  proxy_balancer;
   typedef struct proxy_worker    proxy_worker;
  -typedef struct proxy_conn      proxy_conn;
   typedef struct proxy_conn_pool proxy_conn_pool;
   
   typedef struct {
  @@ -255,16 +254,6 @@
   #endif
   };
   
  -/* 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;
  -
   /* hooks */
   
   /* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and 
  @@ -359,7 +348,7 @@
   PROXY_DECLARE(const char *) ap_proxy_add_balancer(proxy_balancer **balancer, apr_pool_t
*p, proxy_server_conf *conf, const char *url);
   PROXY_DECLARE(void) ap_proxy_add_worker_to_balancer(proxy_balancer *balancer, proxy_worker
*worker);
   PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker, proxy_balancer **balancer,
request_rec *r, proxy_server_conf *conf, char **url);
  -PROXY_DECLARE(apr_status_t) ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
proxy_server_conf *conf, proxy_module_conf *mconf,
  +PROXY_DECLARE(apr_status_t) ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
proxy_server_conf *conf, proxy_worker *worker, proxy_conn_rec *conn,
                                                             apr_pool_t *ppool, apr_uri_t
*uri, char **url, const char *proxyname, apr_port_t proxyport,
                                                             char *server_portstr, int server_portstr_size);
   
  
  
  

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