summaryrefslogtreecommitdiffstats
path: root/modules/proxy/mod_serf.c
diff options
context:
space:
mode:
authorJean-Frederic Clere <jfclere@apache.org>2009-09-30 10:50:57 +0200
committerJean-Frederic Clere <jfclere@apache.org>2009-09-30 10:50:57 +0200
commit406bf000e2cac6c322d9c7349fb393504634d015 (patch)
tree674fa3b7614e7d890b96080823ac0cd26fa08c2e /modules/proxy/mod_serf.c
parentSpelling fix in comment. (diff)
downloadapache2-406bf000e2cac6c322d9c7349fb393504634d015.tar.xz
apache2-406bf000e2cac6c322d9c7349fb393504634d015.zip
Add port in the logic.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@820213 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/mod_serf.c')
-rw-r--r--modules/proxy/mod_serf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/proxy/mod_serf.c b/modules/proxy/mod_serf.c
index 80e594ba9e..a4eff6bda2 100644
--- a/modules/proxy/mod_serf.c
+++ b/modules/proxy/mod_serf.c
@@ -835,6 +835,7 @@ typedef struct hb_server_t {
int busy;
int ready;
int seen;
+ unsigned int port;
} hb_server_t;
static void
@@ -913,6 +914,7 @@ static apr_status_t read_heartbeats(const char *path,
t++;
server = apr_pcalloc(pool, sizeof(hb_server_t));
server->ip = ip;
+ server->port = 80;
server->seen = -1;
apr_table_clear(hbt);
@@ -930,6 +932,10 @@ static apr_status_t read_heartbeats(const char *path,
server->seen = atoi(apr_table_get(hbt, "lastseen"));
}
+ if (apr_table_get(hbt, "port")) {
+ server->port = atoi(apr_table_get(hbt, "port"));
+ }
+
if (server->busy == 0 && server->ready != 0) {
/* Server has zero threads active, but lots of them ready,
* it likely just started up, so lets /4 the number ready,
@@ -1002,8 +1008,7 @@ static int hb_list_servers(void *baton,
if (hbs->ready > 0) {
x = apr_palloc(r->pool, sizeof(ap_serf_server_t));
x->ip = apr_pstrdup(r->pool, hbs->ip);
- /* TODO: expand multicast format to support ports? */
- x->port = 80;
+ x->port = hbs->port;
APR_ARRAY_PUSH(servers, ap_serf_server_t *) = x;
}
}