Skip to content

Commit

Permalink
Add route and redirect to worker so they can be set trough configurat…
Browse files Browse the repository at this point in the history
…ion.

Add worker status flag definitions.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104611 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
wrowe committed Aug 11, 2004
1 parent b0d2c77 commit d3fafc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 11 additions & 2 deletions modules/proxy/mod_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ struct proxy_conn_pool {
proxy_conn_rec *conn; /* Single connection for prefork mpm's */
};

/* woker status flags */
#define PROXY_WORKER_INITIALIZED 0x0001
#define PROXY_WORKER_IN_SHUTDOWN 0x0010
#define PROXY_WORKER_DISABLED 0x0020
#define PROXY_WORKER_IN_ERROR 0x0040

#define PROXY_WORKER_IS_USABLE(f) (!((f)->status & 0x00F0))


/* Worker configuration */
struct proxy_worker {
int status;
Expand All @@ -223,6 +232,8 @@ struct proxy_worker {
const char *name;
const char *scheme; /* scheme to use ajp|http|https */
const char *hostname; /* remote backend address */
const char *route; /* balancing route */
const char *redirect; /* temporary balancing redirection route */
apr_port_t port;
int min; /* Desired minimum number of available connections */
int smax; /* Soft maximum on the total number of connections */
Expand Down Expand Up @@ -251,8 +262,6 @@ typedef struct {
double lbstatus; /* Current lbstatus */
apr_size_t transfered; /* Number of bytes transfered to remote */
apr_size_t readed; /* Number of bytes readed from remote */
const char *route;
const char *redirect;
} proxy_runtime_worker;

struct proxy_balancer {
Expand Down
5 changes: 2 additions & 3 deletions modules/proxy/proxy_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,15 +1450,14 @@ PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function,
{
apr_status_t rv;

if (!worker->status) {
if (!(worker->status & PROXY_WORKER_INITIALIZED)) {
if ((rv = init_conn_worker(worker, s)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
"proxy: %s: failed to initialize worker for (%s)",
proxy_function, worker->hostname);
return DECLINED;
}
/* TODO: make worker status codes */
worker->status = 1;
worker->status = PROXY_WORKER_INITIALIZED;
}
#if APR_HAS_THREADS
if (worker->hmax) {
Expand Down

0 comments on commit d3fafc6

Please sign in to comment.