httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy mod_proxy.h
Date Wed, 11 Aug 2004 21:20:07 GMT
wrowe       2004/08/11 14:20:07

  Modified:    modules/proxy mod_proxy.h
  Log:
  Add initial structures for connection pool and load balancer.
  
  Submitted by: mturk
  
  Revision  Changes    Path
  1.94      +62 -2     httpd-2.0/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.h,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- mod_proxy.h	4 Aug 2004 00:32:07 -0000	1.93
  +++ mod_proxy.h	11 Aug 2004 21:20:07 -0000	1.94
  @@ -51,6 +51,7 @@
   #include "apr_date.h"
   #include "apr_strmatch.h"
   #include "apr_fnmatch.h"
  +#include "apr_reslist.h"
   #define APR_WANT_STRFUNC
   #include "apr_want.h"
   
  @@ -99,8 +100,8 @@
   };
   
   struct proxy_alias {
  -    const char *real;
  -    const char *fake;
  +    const char  *real;
  +    const char  *fake;
   };
   
   struct dirconn_entry {
  @@ -123,6 +124,8 @@
       apr_array_header_t *noproxies;
       apr_array_header_t *dirconn;
       apr_array_header_t *allowed_connect_ports;
  +    apr_array_header_t *workers;
  +    apr_array_header_t *balancers;
       const char *domain;		/* domain name to use in absence of a domain name in the request
*/
       int req;			/* true if proxy requests are enabled */
       char req_set;
  @@ -188,6 +191,60 @@
           int content_length; /* length of the content */
   } proxy_completion;
   
  +/* Physical connection to the backend server */
  +typedef struct {
  +    apr_pool_t   *pool; /* Subpool used for creating socket */
  +    apr_socket_t *sock;
  +    int          close; /* Close 'this' connection */
  +} proxy_conn;
  +
  +/* Connection pool */
  +typedef struct {
  +    apr_pool_t     *pool;   /* The pool used in constructor and destructor calls */
  +    apr_sockaddr_t *addr;   /* Preparsed remote address info */
  +    int            min;     /* Desired minimum number of available connections */
  +    int            smax;    /* Soft maximum on the total number of connections */
  +    int            hmax;    /* Hard maximum on the total number of connections */
  +#if APR_HAS_THREADS
  +    apr_reslist_t  *res;    /* Connection resource list */
  +#else
  +    proxy_conn     *conn;   /* Single connection for prefork mpm's */
  +#endif
  +} proxy_conn_pool;
  +
  +/* Worker configuration */
  +typedef struct {
  +    int             status;
  +    apr_time_t      error_time; /* time of the last error */
  +    apr_interval_time_t retry;  /* retry interval */
  +    int             retries;    /* number of retries on this worker */
  +    int             lbfactor;   /* initial load balancing factor */
  +    const char      *scheme;    /* scheme to use ajp|http|https */
  +    const char      *hostname;  /* remote backend address */
  +    apr_port_t      port;
  +    proxy_conn_pool *cp;        /* Connection pool to use */
  +    void            *opaque;    /* per scheme worker data */
  +} proxy_worker;
  +
  +/* Runtime worker status informations. Shared in scoreboard */
  +typedef struct {
  +    proxy_worker    *w;
  +    double          lbfactor;   /* dynamic lbfactor */
  +    double          lbsatus;    /* Current lbstatus */
  +    apr_size_t      transfered; /* Number of bytes transfered to remote */
  +    apr_size_t      readed;     /* Number of bytes readed from remote */
  +} proxy_runtime_worker;
  +
  +struct proxy_balancer {
  +    apr_array_header_t *workers; /* array of proxy_runtime_workers */
  +    const char *name;            /* name of the load balancer */
  +    const char *sticky;          /* sticky session identifier */
  +    int         sticky_force;    /* Disable failover for sticky sessions */
  +    apr_interval_time_t timeout; /* Timeout for waiting on free connection */
  +#if APR_HAS_THREADS
  +    apr_thread_mutex_t  *mutex;  /* Thread lock for updating lb params */
  +#endif
  +};
   
   /* hooks */
   
  @@ -254,6 +311,9 @@
   PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t
*, const char *, proxy_server_conf *, server_rec *, apr_pool_t *);
   PROXY_DECLARE(int) ap_proxy_ssl_enable(conn_rec *c);
   PROXY_DECLARE(int) ap_proxy_ssl_disable(conn_rec *c);
  +
  +/* Connection pool API */
  +
   
   /* For proxy_util */
   extern module PROXY_DECLARE_DATA proxy_module;
  
  
  

Mime
View raw message