summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/server/mod-wiring.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-03-27 06:24:56 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-03-27 06:24:56 +0000
commitd64a280c20229e374684e9b5e392fdf878ed5514 (patch)
treebd0edee43d0f6569824a3d3d38960a5602c58da8 /sca-cpp/trunk/modules/server/mod-wiring.cpp
parentdac887d0f494151b210588ce694c55ce27f07263 (diff)
Add scripts to setup HTTPS support. A few fixes to get HTTPS working end to end with both HTTPD and WSGI servers. Minor cleanup of the HTTPD config scripts.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@928160 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/modules/server/mod-wiring.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/sca-cpp/trunk/modules/server/mod-wiring.cpp b/sca-cpp/trunk/modules/server/mod-wiring.cpp
index c21b0fe254..296181acfa 100644
--- a/sca-cpp/trunk/modules/server/mod-wiring.cpp
+++ b/sca-cpp/trunk/modules/server/mod-wiring.cpp
@@ -48,12 +48,9 @@ namespace modwiring {
*/
class ServerConf {
public:
- ServerConf(server_rec* s) : s(s), start(false), home(""), wiringServerName(""), contributionPath(""), compositeName("") {
+ ServerConf(server_rec* s) : s(s), contributionPath(""), compositeName("") {
}
const server_rec* s;
- bool start;
- string home;
- string wiringServerName;
string contributionPath;
string compositeName;
list<value> references;
@@ -147,6 +144,7 @@ int translateService(request_rec *r) {
// Find the requested component
const ServerConf& sc = httpd::serverConf<ServerConf>(r, &mod_tuscany_wiring);
+ debug(sc.services, "modwiring::translateService::services");
const list<value> p(pathValues(r->uri));
const list<value> svc(assocPath(p, sc.services));
if (isNil(svc))
@@ -288,6 +286,17 @@ const bool confComponents(ServerConf& sc) {
* Called after all the configuration commands have been run.
* Process the server configuration and configure the wiring for the deployed components.
*/
+const int postConfigMerge(const ServerConf& mainsc, server_rec* s) {
+ if (s == NULL)
+ return OK;
+ ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_wiring);
+ sc.contributionPath = mainsc.contributionPath;
+ sc.compositeName = mainsc.compositeName;
+ sc.references = mainsc.references;
+ sc.services = mainsc.services;
+ return postConfigMerge(mainsc, s->next);
+}
+
int postConfig(unused apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp, server_rec *s) {
// Count the calls to post config, skip the first one as
// postConfig is always called twice
@@ -299,11 +308,12 @@ int postConfig(unused apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t
// Configure the wiring for the deployed components
ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_wiring);
- debug(sc.wiringServerName, "modwiring::postConfig::wiringServerName");
debug(sc.contributionPath, "modwiring::postConfig::contributionPath");
debug(sc.compositeName, "modwiring::postConfig::compositeName");
confComponents(sc);
- return OK;
+
+ // Merge the config into any virtual hosts
+ return postConfigMerge(sc, s->next);
}
/**
@@ -321,18 +331,6 @@ void childInit(apr_pool_t* p, server_rec* svr_rec) {
/**
* Configuration commands.
*/
-const char *confHome(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.home = arg;
- return NULL;
-}
-const char *confWiringServerName(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.wiringServerName = arg;
- return NULL;
-}
const char *confContribution(cmd_parms *cmd, unused void *c, const char *arg) {
gc_scoped_pool pool(cmd->pool);
ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
@@ -350,8 +348,6 @@ const char *confComposite(cmd_parms *cmd, unused void *c, const char *arg) {
* HTTP server module declaration.
*/
const command_rec commands[] = {
- AP_INIT_TAKE1("TuscanyHome", (const char*(*)())confHome, NULL, RSRC_CONF, "Tuscany home directory"),
- AP_INIT_TAKE1("SCAWiringServerName", (const char*(*)())confWiringServerName, NULL, RSRC_CONF, "SCA wiring server name"),
AP_INIT_TAKE1("SCAContribution", (const char*(*)())confContribution, NULL, RSRC_CONF, "SCA contribution location"),
AP_INIT_TAKE1("SCAComposite", (const char*(*)())confComposite, NULL, RSRC_CONF, "SCA composite location"),
{NULL, NULL, NULL, 0, NO_ARGS, NULL}