Added baseurl tag to urllist. Following config:

<urllist>
   <baseurl>http://www.site.com</baseurl>
   <url>/</url>
   <url>/foo.html</url>
   <url>/cgi-bin/bar.cgi</url>
</urllist>

...hits those URLs:

http://www.site.com/
http://www.site.com/foo.html
http://www.site.com/cgi-bin/bar.cgi

Usefull when dealing with site/app that gets moved around a lot.


git-svn-id: https://svn.apache.org/repos/asf/httpd/test/trunk/flood@96834 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/config.h.in b/config.h.in
index 4de9b6b..c01592e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -13,6 +13,7 @@
 #define XML_URLLIST_SEQUENCE "sequence"
 #define XML_URLLIST_SEQUENCE_NAME "sequencename"
 #define XML_URLLIST_SEQUENCE_LIST "sequencelist"
+#define XML_URLLIST_BASE_URL "baseurl"
 #define XML_URLLIST_URL "url"
 #define XML_URLLIST_METHOD "method"
 #define XML_URLLIST_METHOD_GET "get"
diff --git a/flood_round_robin.c b/flood_round_robin.c
index e383e4d..bec304c 100644
--- a/flood_round_robin.c
+++ b/flood_round_robin.c
@@ -136,6 +136,7 @@
 
     int urls;
     url_t *url;
+    char *baseurl;
 
     cookie_t *cookie;
 
@@ -664,7 +665,7 @@
     apr_status_t rv;
     int i;
     struct apr_xml_elem *root_elem, *profile_elem,
-           *urllist_elem, *count_elem, *useurllist_elem, *e;
+           *urllist_elem, *count_elem, *useurllist_elem, *baseurl_elem, *e;
     round_robin_profile_t *p;
     char *xml_profile, *xml_urllist, *urllist_name;
 
@@ -732,6 +733,15 @@
              xml_urllist, XML_URLLIST_NAME, urllist_name)) != APR_SUCCESS)
         return rv;
 
+    /* do we have base url? */
+    if ((rv = retrieve_xml_elem_child(
+             &baseurl_elem, urllist_elem, XML_URLLIST_BASE_URL)) == APR_SUCCESS) {
+        /* yes we do */
+        p->baseurl = apr_pstrdup(pool, baseurl_elem->first_cdata.first->text);
+    } else {
+        p->baseurl = NULL;
+    }
+
     p->urls = 0;
     /* Include sequences.  We'll expand them later. */
     p->urls = count_xml_seq_child(urllist_elem);
@@ -828,6 +838,10 @@
 
     r->parsed_uri = apr_pcalloc(rp->pool, sizeof(apr_uri_t));
 
+    if (rp->baseurl != NULL) {
+        r->uri = apr_pstrcat(rp->pool, rp->baseurl, r->uri, NULL);
+    }
+
     apr_uri_parse(rp->pool, r->uri, r->parsed_uri);
     if (r->parsed_uri->scheme == NULL || r->parsed_uri->hostname == NULL) {
         apr_file_printf(local_stderr, "Misformed URL '%s'\n", r->uri);