diff options
Diffstat (limited to 'sca-cpp/trunk/modules/http')
-rw-r--r-- | sca-cpp/trunk/modules/http/httpd.hpp | 27 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/mod-ssltunnel.cpp | 4 |
2 files changed, 18 insertions, 13 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp index 7c839c1306..af075a04e8 100644 --- a/sca-cpp/trunk/modules/http/httpd.hpp +++ b/sca-cpp/trunk/modules/http/httpd.hpp @@ -120,6 +120,22 @@ template<typename C> C& dirConf(const void* c) { } /** + * Returns a request-scoped module configuration. + */ +template<typename C> C& makeRequestConf(const request_rec* r, const module* mod) { + C* c = new (gc_new<C>(r->pool)) C(r->pool, r); + ap_set_module_config(r->request_config, mod, c); + return *c; +} + +template<typename C> C& requestConf(const request_rec* r, const module* mod) { + C* c = (C*)ap_get_module_config(r->request_config, mod); + if (c == NULL) + return makeRequestConf<C>(r, mod); + return *c; +} + +/** * Return the host name for a server. */ const string hostName(const server_rec* s, const string& def = "localhost") { @@ -425,17 +441,6 @@ const int reportStatus(const failable<int>& rc) { } /** - * Construct a redirect URI. - */ -const string redirectURI(const string& file, const string& pi) { - return file + pi; -} - -const string redirectURI(const string& file, const string& pi, const string& args) { - return file + pi + "?" + args; -} - -/** * Convert a value to an HTTPD request struc */ request_rec* request(const value& v) { diff --git a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp index 49ce6bbe52..f6a239efe1 100644 --- a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp +++ b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp @@ -78,7 +78,7 @@ int postConfigMerge(ServerConf& mainsc, apr_pool_t* p, server_rec* s) { if (s == NULL) return OK; ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_ssltunnel); - debug(httpd::serverName(s), "modwiring::postConfigMerge::serverName"); + debug(httpd::serverName(s), "modssltunnel::postConfigMerge::serverName"); // Merge configuration from main server if (length(sc.ca) == 0 && length(mainsc.ca) !=0) @@ -105,7 +105,7 @@ int postConfigMerge(ServerConf& mainsc, apr_pool_t* p, server_rec* s) { int postConfig(apr_pool_t* p, unused apr_pool_t* plog, unused apr_pool_t* ptemp, server_rec* s) { gc_scoped_pool pool(p); ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_ssltunnel); - debug(httpd::serverName(s), "modwiring::postConfig::serverName"); + debug(httpd::serverName(s), "modssltunnel::postConfig::serverName"); // Register the SSLTUNNEL method M_SSLTUNNEL = ap_method_register(p, "SSLTUNNEL"); |